Technical Discussion :: Java
Home > Freshers > Technical Interview Questions > Java
10. What is the difference between static and non-static variables?
Answer:
'static' is a keyword available in Java. The variable that is declared as static, is called as class variable. All instances share the same copy of the variable.
Eg.: static int y=1;
Asked In :: iGate Syntel Inc. Accenture
'static' is a keyword available in Java. The variable that is declared as static, is called as class variable. All instances share the same copy of the variable.
Eg.: static int y=1;