METHODS IN JAVA

Maha

METHODS IN JAVA

Methods in java are the same as functions in other programming language. It will execute a block of code whenever it is being called.

Syntax

--Declaring a method ---

Datatype methodname(){

//block of code

}

--calling a method---

methodname()

Types of Methods

1.   Method with parameter without return type.

2.   Method without parameter without return type.

3.   Method with parameter with return type.

4.   Method without parameter with return type.

Parameters and Arguments

They are the values which is passed during the run time of the program.


Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send