previous | start | next

Syntax 3.1: Method Definition

accessSpecifier returnType methodName(parameterType parameterName, . . .)
{
method body }

Example:

 
public void deposit(double amount)
{
. . .
}

Purpose:

To define the behavior of a method


previous | start | next