What is the difference between void and return data type in JAVA? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between void and return data type in JAVA?

Please explain in detail as I am failing to understand the concept of these data types.

8th Sep 2018, 3:40 AM
Prince Gupta
Prince Gupta - avatar
1 Answer
+ 2
These are return type of methods... void returns nothing whereas return can return primitive data types, arrays etc.. Go on SoloLearn lessons for more details
8th Sep 2018, 4:08 AM
Rishabh
Rishabh - avatar