File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Mock Exam Errata and the fly likes Rules Roundup #20 (vague wording) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Rules Roundup #20 (vague wording)" Watch "Rules Roundup #20 (vague wording)" New topic

Rules Roundup #20 (vague wording)

Yuri Sforza

Joined: Apr 15, 2002
Posts: 15
Can a private method of a superclass
be declared within a subclass?

The answer given is YES and explanation says
that "Private methods cannot be overriden,
but they can be re-declared/redefined in the
OK, but the question was about declare,
not about re-declare. For me they are
different terms. I think that method (whether
private or not) may be declared only once
(in the class in question or somewhere higher
in the inheritance hierarchy). When talking
about subclass, what you can do (or try to do)
is re-declaring, overriding, "declaring method
with the same signature as in superclass", ...
but you cannot say that you are "declaring method
of a superclass".
Am I missing something? Comments anybody?

Y. Sforza
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
To be 100% JLS compliant the wording should be something like this:
"Can a subclass declare a method that has the same signature than a private method in its superclass?"
Note that the access modifier is NOT part of the signature of a method.

[Blog] [Blogroll] [My Reviews] My Linked In
I agree. Here's the link:
subject: Rules Roundup #20 (vague wording)
It's not a secret anymore!