File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about synchronized keyword

 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is the test() function in Father class thread-safe?
 
Rick Salsa
Ranch Hand
Posts: 173
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 464
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic