Java Methods

Introducing Method

In java programming language c lass usually consist of two things instance variable and methods.                                                                                       

Method are the block of statement that perform a special task.

Using methods we can avoid the rewriting the same code over and over in a sane program.

Method increase the efficiency and reduce the complexity of the program. 

Syntax of Method Definition

Write a program to demonstrate method in class.

Result

Parameterized(overloaded) Method

Write a program to demonstrate parameterized method in class.