File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Private methods overridden? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Private methods overridden?" Watch "Private methods overridden?" New topic

Private methods overridden?

Paul Salerno
Ranch Hand

Joined: Jan 17, 2002
Posts: 172
I have two different examples which indicate that it is legal to override a private method with one of less restrictions, of course the other statement indicates that this is illegal.
Case 1:

Case 2:
"A subclass of an object cannot access private variables or private methods of its own superclass." "Private methods of superclass not inherited by subclass or overridden by subclass." "The method in the subclass only shares the same name as the super method therefore the two methods have no relationship"
Again I do thank you for your help in advance.
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
Please refer to the following thread posted yesterday about the same topic:

[Blog] [Blogroll] [My Reviews] My Linked In
Consider Paul's rocket mass heater.
subject: Private methods overridden?
Similar Threads
doubt private method
mock exam problem
JWhiz Question
[B] a private final method can be overridden!!!! [/B]
Override Method...