Methods in Java.

In Java, A method is a collection of statements that are grouped together to perform a certain task or operation.

Code :