0
what does "return" in void name()?
I cant understand. Please explain me, what difference betweein void with "return" and without
3 Answers
+ 2
return in void has no meaning, because void returns nothing. Some people use return to stop the code execution in a method (maybe because a condition was false).
+ 1
in void return does an error...đđđ
0
@Amrit Mahendra Joseph
Yes, you are not allowed to return an object, but return nothing is ok.
return; // is ok
return (something); // throws error