class Parent def callee puts 'parent method' end end class Child < Parent def callee puts 'child method' end def caller Parent.instance_method(:callee).bind(self).call end end
class Parent def callee puts 'parent method' end end class Child < Parent alias parent_callee callee def callee puts 'child method' end def caller parent_callee end end
class Parent def callee puts 'parent method' end end class Child < Parent def callee puts 'child method' end def caller method(:callee).super_method.call end end
abstract class Parent { public void callee() { System.out.println("parent method"); } } class Child extends Parent { @Override public void callee() { System.out.println("child method"); } public void caller() { super.callee(); } } public class App { public static void main(String[] args) { new Child().caller(); } }
trait Parent { def callee: Unit = println "parent method" } class Child extends Parent { override def callee: Unit = println "child method" def caller: Unit = super.callee }
class Parent callee: -> console.log "parent method" class Child extends Parent callee: -> console.log "child method" caller: -> @constructor.__super__.constructor.prototype.callee.call @
public class Parent { public void Callee() { Console.WriteLine("parent method"); } } public class Child: Parent { public void Callee() { Console.WriteLine("child method"); } public void Caller() { base.Callee(); } }
class Parent { public: void callee(); }; void Parent::callee() { cout << "parent method" << endl; } class Child: Public Parent { public: void callee(); void caller(); }; void Child::callee() { cout << "child method" << endl; } void Child::caller() { Parent::callee(); } int main() { Child *child = new Child(); child -> caller(); child -> Parent::callee(); }
class Parent: def callee(self): print("parent method") class Child(Parent): def callee(self): print("child method") def caller(self): super(Child, self).callee()