A function is named unit of a group of program statements that carry out a particular
task. This unit can be invoked/called from other parts of the program.
Reasons to use a method/function:
o To allow us to cope with complex problems
When programs become more and more complex i.e. when they grow
in size, generally they become unruly. So a complex task is taken and
divided into smaller, more easily understood tasks. In Java those smaller
tasks are implemented as functions.