• Post Reply Bookmark Topic Watch Topic
  • New Topic

about synchronized keyword

 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • 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
  • 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
  • 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!