What is a static variable in Java?
A. A variable that is shared among all instances of a class.
B. A variable that can only be accessed from within a method.
C. A variable that is created when an object is instantiated.
D. None of the above.
Answer:A
What is a static variable in Java?
A. A variable that is shared among all instances of a class. B. A variable that can only be accessed from within a method. C. A variable that is created when an object is instantiated. D. None of the above.