my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "about synchronized keyword" Watch "about synchronized keyword" New topic
Author

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.
-rick
Ragu Sivaraman
Ranch Hand

Joined: Jul 20, 2001
Posts: 464
Originally posted by Niu Xiuyuan:
[B]
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
HIH
Ragu
 
 
subject: about synchronized keyword
 
Similar Threads
Overriding Private method
Inheritance and casting...
Mock Question
father & mother class
Can someone explain the error @ Line-03