fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class A {
  9. public void paint() {
  10. System.out.print("A");
  11. draw();
  12. }
  13. public void draw() {
  14. System.out.print("B");
  15. this.draw();
  16. }
  17. }
  18.  
  19. class B extends A {
  20. public void paint() {
  21. super.draw();
  22. System.out.print("C");
  23. this.draw();
  24. }
  25. public void draw() {
  26. System.out.print("D");
  27. }
  28. }
  29. class EraonEdu {
  30. public static void main(String[] args) {
  31. A b = new B();
  32. b.paint();
  33. b.draw();
  34. }
  35. }
  36.  
Success #stdin #stdout 0.09s 52576KB
stdin
Standard input is empty
stdout
BDCDD