Question: what is the difference between static variable and non static variable in java?
Answer: A static variable acts as a global variable and is shared among all the objects of the class. A non-static variables are specific to instance object in which they are created.