java - Overriding a method in a subclass while retaining the contents of the superclass method -
java - Overriding a method in a subclass while retaining the contents of the superclass method -
in java, there way override superclass method in subclass while retaining contents of superclass method? this:
class person { public void update(){ statement 1; statement 2; } } class pupil extends person { @override public void update(){ super().update(); statement 3; statement 4; } }
such calling update() on pupil cause statements 1, 2, 3 , 4 executed?
place super.update()
in origin of subclass method.
java
Comments
Post a Comment