void is used here and still it returns a value,why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

void is used here and still it returns a value,why?

23rd Sep 2016, 2:09 PM
harshita
2 Answers
+ 1
Read again. What you think is a return value is probably just a reference.
23rd Sep 2016, 2:37 PM
Zen
Zen - avatar
0
It doesn't "return" a value, it only prints a value, hence the System.out.printIn
22nd Jan 2017, 6:59 PM
Golan Gil
Golan Gil - avatar