Methods are an important construct of Java programming. A method in Java comprises of:

- name
- input list (may be empty)
- return type (use void if you do not want to return anything )
- code to perform calculations/actions

Java Code:
int addValues(int a, int b)
{
 return a + b;
}