1. To set a method to return a specific type of value.
2. To use the return statement in multiple different ways.
3. To store the data returned from a method.
The return statement uses a java keyword called return at the end of a method that'll send data back to where the method was invoked.
1. In the method header, put the data type you are trying to return instead of void.
2. Inside the method, use the keyword return followed by the data you want to send back. That data can be sent as raw data or a variable.
3. When calling a method with a return type, you'll need to set it equal to a variable to retain the value.
Guidelines
This is the final bridge between methods. If you get user input in the main method, you can send it to a method as an argument, make any necessary changes you'd like, then return that data back to the main method for further use.
1. Add methods to a program you have written that does not have them.
2. Include parameters if you can.
3. Must include the use of return statements.