Functions

Functions (also called methods) are reusable blocks of code. They help organize your program.

public int addNumbers(int a, int b) {
    int sum = a + b;
    return sum;
}
public void addNumbers(int a, int b) {
    int sum = a + b;
    System.out.println("Answer: " + sum);
}