- Method: is a set of instructions/statements that are identified with a name, that can be called again with that name.
- Reduces redundancy
- A method is defined with a name, return type, input parameters with type
Ex:int sum(int x, int y){
return x+y;
} - If there is no return paramteres then it should be void
Ex:void saySomething(String something){
println(something);
} - A method can return only one parameter.
- You can define your own methods or use the ones provided by processing or libraries.