Wiki Markup |
---|
When a class declares a static method _m_, the declaration of _m_ hides any method _m'_, where the signature of _m_ is a subsignature of the signature of _m'_ and the declaration of _m'_ is both in the superclasses and superinterfaces of the declaring class and also would otherwise be accessible to code in the declaring class (_Java Language Specification_, [§8.4.8.2 "Hiding (by Class Methods)"|http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8.2]\[[JLS 2005|AA. Bibliography#JLSReferences#JLS 05]\]). |
An instance method defined in a subclass overrides another instance method in the superclass when both have the same name, number and type of parameters, and return type.
...
Wiki Markup |
---|
The methods inherited from the superclass can also be overloaded in a subclass. Overloaded methods are new methods unique to the subclass and neither hide nor override the superclass method \[[Tutorials 2008|AA. Bibliography#TutorialsReferences#Tutorials 08]\]. |
Wiki Markup |
---|
Technically, a private method cannot be hidden or overridden. There is no requirement that private methods with the same signature in the subclass and the superclass bear any relationship in terms of having the same return type or {{throws}} clause, the necessary conditions for hiding \[[JLS 2005|AA. Bibliography#JLSReferences#JLS 05]\]. Consequently, hiding cannot occur when private methods have different return types or {{throws}} clauses. |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a8d8301fdc322bae-2a707d3e-41694ab0-a8f484e5-94b489b69230f86363be5cb9"><ac:plain-text-body><![CDATA[ | [[Bloch 2005 | AA. Bibliography#Bloch References#Bloch 05]] | Puzzle 48. All I get is static | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="84ad7b9793c3ba90-bd788b84-4e0c4493-87eda939-f7396a8fbbfc4e9f5977647a"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS References#JLS 05]] | [§8.4.8.2, Hiding (by Class Methods) | http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8.2] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="45ffabe124cfc2c8-fec73980-41974c60-8560bf52-bd52a4404a80f94ce2dce7b0"><ac:plain-text-body><![CDATA[ | [[Tutorials 2008 | AA. Bibliography#Tutorials References#Tutorials 08]] | [Overriding and Hiding Methods | http://java.sun.com/docs/books/tutorial/java/IandI/override.html] | ]]></ac:plain-text-body></ac:structured-macro> |
...