+ 3

Difference between using and not using 'static' keyword in java?

does it saves memory?

10th Sep 2017, 5:17 PM
Krishna Kumar
Krishna Kumar - avatar
2 Respuestas
+ 3
Static Methods can access static variables without any objects, however non-static methods and non-static variables can only be accessed using objects.Static methods can be accessed directly in static and non-static methods. For example the static public static void main() method can access the other static methods directly. Also a non-static regular method can access static methods directly.
8th Jan 2018, 4:06 PM
raveena kagne
raveena kagne - avatar