



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1 public class Test 2 { 3 private static int a; 4 private int b; 5 private int c;
6 public static void main( String[] args ) 7 { 8 Test3 ref = new Test3();
9 ref.method1( ref.c ); 10 }
11 public Test3() 12 { 13 c = 3; 14 }
15 public void method1( int x ) 16 { 17 int c = x++; 18 int b;
19 b = c + 3; 20 a = b + 2;
21 System.out.println( "Test3.a = " + Test3.a ); 22 System.out.println( "this.b = " + this.b ); 23 System.out.println( "this.c = " + this.c ); 24 System.out.println( "c = " + c ); 25 System.out.println( "b = " + b ); 26 System.out.println( "a = " + a ); 27 System.out.println( "result = " + method2( c + b ) ); 28 System.out.println( "Test3.a = " + Test3.a ); 29 System.out.println( "this.b = " + this.b ); 30 System.out.println( "this.c = " + this.c ); 31 System.out.println( "a = " + a ); 32 System.out.println( "b = " + b ); 33 System.out.println( "c = " + c ); 34 System.out.println( "x = " + x ); 35 }
36 private int method2( int x ) 37 { 38 int a = x; 39 int c = this.c + Test3.a;
40 x = b = a + c;
41 System.out.println( "Test3.a = " + Test3.a ); 42 System.out.println( "this.b = " + this.b ); 43 System.out.println( "this.c = " + this.c ); 44 System.out.println( "a = " + a ); 45 System.out.println( "b = " + b ); 46 System.out.println( "c = " + c );
47 Test3.a = a + 2; 48 this.b = b + c;
49 return x + 3; 50 } 51 }