Methods are the lines of code that performs a specific function in a program. Methods can either return a value or not return anything. The methods which do not return anything are of type void. The main advantage of methods in a program is code reusability.