This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about synchronized keyword Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "about synchronized keyword" Watch "about synchronized keyword" New topic

about synchronized keyword

Niu Xiuyuan
Ranch Hand

Joined: Jun 08, 2001
Posts: 68

is the test() function in Father class thread-safe?

Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Rick Salsa
Ranch Hand

Joined: Jul 17, 2001
Posts: 173
I don't think it does because in the class Father, test() is overriden. I believe that you need the synchronized keyword still.
Ragu Sivaraman
Ranch Hand

Joined: Jul 20, 2001
Posts: 464
Originally posted by Niu Xiuyuan:
is the test() function in Father class thread-safe?[/B]

Synchronized dont participate in Overriding or any OO paradigm
So to make it thread-safe you need to do it at the each individual class
I agree. Here's the link:
subject: about synchronized keyword
Similar Threads
Overriding Private method
Inheritance and casting...
Mock Question
father & mother class
Can someone explain the error @ Line-03