java - How do I call an overridden parent class method from a child class? -


if have subclass has methods i've overridden parent class, , under specific situations want use original methods, how call methods?

call super

class {    int foo () { return 2; } }  class b extends {     boolean somecondition;     public b(boolean b) { somecondition = b; }     int foo () {         if(somecondition) return super.foo();        return 3;    } } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -