fork download
  1. class Test
  2. {
  3. private static int a;
  4. private int b;
  5. public static int methodA(){
  6. return ++a;
  7. }
  8.  
  9. public int methodB(){
  10. return methodA();
  11. }
  12. public static void main (String[] args)
  13. {
  14. Test obj = new Test();
  15. System.out.print(obj.methodB()+" ");
  16. System.out.print(obj.methodA());
  17. }
  18. }
Success #stdin #stdout 0.11s 55604KB
stdin
Standard input is empty
stdout
1 2