fork download
  1. class Base
  2. {
  3. public Base()
  4. {
  5. method();
  6. }
  7. void method()
  8. {
  9. System.out.println("In Base");
  10. }
  11. }
  12.  
  13. class Derived extends Base
  14. {
  15. private String bar;
  16. public Derived(String txt)
  17. {
  18. bar=txt;
  19. }
  20. /*public void method()
  21. {
  22. System.out.println(bar.length());
  23. }*/
  24.  
  25. public static void main(String[] args)
  26. {
  27. Derived base=new Derived("bar");
  28. base.method();
  29. }
  30. }
Success #stdin #stdout 0.06s 380160KB
stdin
Standard input is empty
stdout
In Base
In Base