Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inheritance  RSS feed

 
Rodger, Gao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can anyone help on this?
If I have a parent class with one method in synchronized feature, is the synchronzed feature inherited by its sub class?
Thanks all.
Rodger Gao
 
Mike Birken
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Synchronized methods are inherited as long as they are not private. A non-private synchronized method can be overridded and the replacement method does not have to be synchronized (it is optional).
- Mike
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!