Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic