What is the use of return statement in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use of return statement in java

Return

5th Feb 2022, 6:02 AM
Kaustubh Dabhade
Kaustubh Dabhade - avatar
3 Answers
+ 2
Kaustubh Dabhade The return statement is used within a function to RETURN the result of the function. Returning a function result gives you an item which may be operated upon further, similar to a variable. Within a function, return also stops any further iteration, because you have achieved a result. Cristian Gabriel Mazzulla has given you a great example
5th Feb 2022, 8:50 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Thanks will check
5th Feb 2022, 6:10 AM
Kaustubh Dabhade
Kaustubh Dabhade - avatar