Web Analytics

Can somebody plz explain this question to me?


What is the output of the program shown below?


public class SomeClass

{

private int x, y;


public SomeClass (int xValue, int yValue)

{

x = xValue;

y = yValue;

}

public void m1()

{

x = 30;

System.out.print((y + 1) + " ");

}

public void m2()

{

m1();

System.out.print(x + " ");

}

}

public class Tester

{

public static void main (String[] args)

{

int x = 10;

int y = 20;

SomeClass z = new SomeClass(y, x);

z.m2();

z.m1();

}

}


21 10 21

21 30 21

11 30 11

1 10 11

11 30 21