+ 2
Examples of "Void" methods
What makes a method void? I know it's if it doesn't return a value, but what counts as a "value". Is a printed string of text not a value?
1 Resposta
+ 2
A value is something that can be stored in a variable. Basically, any information is a value.
Printing text does not count as returning a value. It has to have the keyword, “return” followed by a value.
If you can do this, it has a return value:
someType var = func(param);
If not, it does not.