posted 11 years ago
In line 17 you have used Q.x where Q is class that you have created and x is static variable which can be accessed by using classname.variablename,so it wil print 11 because the value assigned to the instance variable x is 11 in the class Q,and in line 20, it will print 33 because it is called by using the object of the class which you have created because whenever you create a object, memory is allocated for that particular object,so if if you to print 44 instead of 33 you have to change the value of the instance variable y in that object,and then you can use q.y to print 44.
You can do anything you set your mind to do.