Q. What does the ‘static’ keyword do in Java?

A
Makes a variable unique to each instance
B
Makes a variable or method belong to the class, not instances
C
Prevents a variable from being modified
D
Declares a variable as final
Solution:

Static members are shared across all instances of a class and can be accessed without instantiation.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!