fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Base{
  5. protected int x;
  6. protected void m(){
  7. x++;
  8. }
  9.  
  10. protected void n(){
  11. x++; // <- defect
  12. m();
  13. }
  14. }
  15.  
  16.  
  17. class Sub extends Base{
  18. protected void m(){
  19. n();
  20. }
  21. public void print() {
  22. m();
  23. System.out.println(x);
  24. }
  25. }
  26.  
  27. class Main
  28. {
  29. public static void main (String[] args) throws java.lang.Exception
  30. {
  31. Sub sub = new Sub();
  32. sub.print();
  33. }
  34. }
Runtime error #stdin #stdout 0.11s 380544KB
stdin
Standard input is empty
stdout
Standard output is empty