class Foo { public void foo() { System.out.println(this.toString() + ": foo()"); } } class Bar extends Foo { public void bar() { System.out.println(this.toString() + ": bar()"); } } public class FooBar { public static void main(String[] args) { /* Bar extends Foo (and this is to-do) */ } }