What is the purpose of the "static" keyword in Java?
A. To indicate that a method or variable belongs to a class rather than an instance of the class.
B. To indicate that a method or variable can only be accessed within the same package.
C. To indicate that a method or variable cannot be overridden by a subclass.
D. None of the above.
Answer:A
What is the purpose of the "static" keyword in Java?
A. To indicate that a method or variable belongs to a class rather than an instance of the class. B. To indicate that a method or variable can only be accessed within the same package. C. To indicate that a method or variable cannot be overridden by a subclass. D. None of the above.