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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -