Back to Developer Roadmap

Static Keyword

src/data/roadmaps/java/content/[email protected]

4.0833 B
Original Source

Static Keyword

The static keyword in Java is used to create members (variables and methods) that belong to the class itself, rather than to any specific instance of the class. This means there's only one copy of a static variable shared by all objects of that class, and you can access static members directly using the class name without needing to create an object. Static methods can only access static variables and call other static methods.

Visit the following resources to learn more: