+ 2
why should we use "static void" for method declaration?
4 Answers
+ 2
static methods are binded with the class anf to call these methods no need to create the object of class. these methods can be called directly by using class name
+ 1
just do it, later u will see all other types of instance methods with return tupes...
static -> a lot info in course and on forum
void -> method doesn't return anything to caller
+ 1
okay thanks..
+ 1
You just asked two questions which are...
1. why should we use "static", and
2. why should we use "void" keywords...
Answers
1. you use static to avoid instantiating the class with the "new" keyword before accessing the property or method
2. You use void to specify that the method returns nothing or the "return" keyword wasn't used at all in the method.
I hope it helps..