0
Why we more often use static void while defining a method?
2 odpowiedzi
+ 3
- static means that a method can called directly on the class without being associated with the object instance.
- void means that the method does not return any value.
The main method of a Java application must be
- public (can be accessed from any external class)
- static (since it will be invoked without creating an object)
- void (explained earlier)
and collect array parameter — args that contain the command line arguments passed to it as strings
+ 2
Who said that mostly static void is used? It all depends on returns type of the method and if it belongs to the class or the instance.