A method is a group of statements used to complete a specific task. A method has a return value, a name, a set of parameters, and a body. Parameters are passed to a method and are used to perform an action. If a value is to be returned from a method, the return statement is used. A method may have zero or more return statements. A method that returns void may use a return statement but the statement does not have an argument.
Methods are defined as part of the class definition and normally follow the declaration of the instance variables. The method declaration specifies a return type. The return type
void means that the method does not return a value.
The Java naming convention for methods specifies that the first word ...