0
What is static void?
I am wondering what static void means and how I can use it.
5 Réponses
+ 3
The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made. The keyword void simply tells the compiler that main( ) does not return a value.
0
Static void are a combination of two variables by using which we can execute a program without creating an object
- 1
static void main
it means that the main function is static , 😁
but it signifies that we can instantiate class members inside the main function without creating objects
- 1
why would the information ie "string, int, double" be important to the main and class and what is the point of having no value?
- 1
static is a keyword. If a method was declare as static, you can call it without creating any object(instance).
void is a keyword, too. If a method does not return any value, you should use void keyword when declare the method. In the case you want to return an Integer from a method, then you must replace the void keyword by int.