return In Java: Know the Fundamentals
The return keyword stops the execution of a function and returns the desired output. Even if there’s no value to return, it will use void as a return type. Furthermore, you can use return without a value to stop the execution of a function