fork(4) download
  1. class Example
  2. {
  3. public static void main (String[] args)
  4. {
  5. new Child().bar();
  6. }
  7. }
  8. class Parent {
  9. protected void foo() {
  10. System.out.println("Parent#foo");
  11. }
  12. public void bar() {
  13. this.foo();
  14. }
  15. }
  16. class Child extends Parent {
  17. @Override
  18. protected void foo() {
  19. System.out.println("Child#foo");
  20. }
  21. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
Child#foo