0
What is 'static'? What does it mean and what is it used for?
2 Réponses
+ 2
If you want a bunch of utility functions available throughout you app declare them as static methods in a class and you can use them whenever and wherever without having to instantiate an object of that class. Just like you use Math.sqrt as Aditya pointed out.
0
static variables and function are access without using object of class, like
Math.sqrt
sqrt is static in Math class. Without static is like
Scanner s = new Scanner(System.in);
here you have to create object on Scanner to use
s.nextLine();
function, coz nextLine() is not static.