Java: Calling super.someMethod()
super.someMethod()
calls someMethod
of the base class. It is often used in an overriding method.
Here's an example:
You can of course call super.someMethod()
anywhere from the subclass. This will "bypass" any overridden version of the method.
You can not reach in to the base class of the base class by doing super.super.someMethod()
.
☞
Not to be confused with
-
super()
, see Calling super(), or -
SomeClass.super.someMethod()
, see Calling super method of outer class from inner class
Comments
Be the first to comment!