Hi
Please try to understand why this program produce 100 200 as output. I was expecting out put as 100 200 30 40
class MyClass{ int x=100; int y=200; void MyClass(){ System.out.print(x+" "); System.out.print(y+" "); x=30; y=40; } } class Demo{ public static void main (String []args){ MyClass c=new MyClass(); System.out.print(c.x+" "); System.out.print(c.y+" "); } }