fork download
  1. public class Tester{
  2. public static void main (String[] args){
  3. Test4 t = new Test4();
  4. t.methodA();
  5. }
  6. }
  7. class Test4{
  8. public int sum;
  9. public int y;
  10. public void methodA(){
  11. int x=0;
  12. int z = 0;
  13. while (z < 5){
  14. y = y + sum;
  15. x = y + 1;
  16. System.out.println(x + " " + y+ " " + sum);
  17. sum = sum + methodB(x, y);
  18. z++;
  19. }
  20. }
  21. public int methodB(int m, int n){
  22. int x = 0;
  23. int sum = 0;
  24. y = y + m;
  25. x = n - 4;
  26. sum = sum + y;
  27. System.out.println(x + " " + y+ " " + sum);
  28. return sum;
  29. }
  30. }
  31.  
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Tester is public, should be declared in a file named Tester.java
  public class Tester{
         ^
1 error
stdout
Standard output is empty