Question: class Test { int x = 3 ; static int y = 5 ; public void test ( int x ) { Test t =

class Test {
int x =3;
static int y =5;
public void test(int x){
Test t = new Test();
x =6;
this.x =7;
y =4;
}
public static void main(String args[]){
Test t = new Test();
int x =2;
t.test(x);
System.out.println(x);
System.out.println(t.x);
System.out.println(t.y);
System.out.println(y);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!