Methods in JAVA

A method consists of related set of statements to perform a specific task.

Method may or may not return some value. Methods provides us the facility to use the same set of code again and again.

Syntax:

<access-specifier><return-type><name>(arguments?)

{

//set of statements

}

Leave a Reply

Your email address will not be published. Required fields are marked *