We use a class's name to access its static methods and variables in java. And accessing static variables and methods using a class name is considered one of the benefits of the static keyword. But how and why is it better than creating an object and then accessing the methods and variables? Does it save space and time?
Asked
Active
Viewed 22 times
0
-
2Does this answer your question? [When to use static methods](https://stackoverflow.com/questions/2671496/when-to-use-static-methods) – Turamarth May 06 '21 at 09:58
-
@Tom 'Also related' how? – user207421 May 06 '21 at 10:04