File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about overriding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "about overriding" Watch "about overriding" New topic
Author

about overriding

Sujittt Tripathyrr
Ranch Hand

Joined: Jun 21, 2006
Posts: 96
why the synchronized method overriding can be possible with a non synchronized method.

Thanks in advance
Rohit Suman
Ranch Hand

Joined: Sep 09, 2006
Posts: 37
hi the answer to your question is that when method is overriden in the subclass to non synchronized it's not guaranted that every time we will be creating thread of subclass. So Sun has allowed this behaviour and the rule for overriding is that we can't decrease the accessibility modifier i.e. public,protected,default and private. The method declared public cannot be overridden to protected so mainly you have to focus in exam whether these accessibilty modifier are decreasing the accessibility or not.
Sujittt Tripathyrr
Ranch Hand

Joined: Jun 21, 2006
Posts: 96
Thanks Rohit
 
 
subject: about overriding
 
Similar Threads
Synchronized and Abstract modifiers
Implementing abstract methods in the concrete subclass
Abstract Synchronized
Polymorphic Synchronized methods
can we put synchronized keyword infront of run method of Runnable interface ?