File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!