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
Post a Comment