0

What is static void?

I am wondering what static void means and how I can use it.

10th Dec 2016, 5:13 PM
Joaquin D Ayala
Joaquin D Ayala - avatar
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.
10th Dec 2016, 5:42 PM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar
0
Static void are a combination of two variables by using which we can execute a program without creating an object
11th Dec 2016, 4:10 AM
Anand Chourasiya
Anand Chourasiya - avatar
- 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
10th Dec 2016, 5:18 PM
Morpheus
Morpheus - avatar
- 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?
10th Dec 2016, 9:43 PM
Joaquin D Ayala
Joaquin D Ayala - avatar
- 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.
11th Dec 2016, 12:09 AM
The PGDeveloper
The PGDeveloper - avatar