previous | start | next

Syntax 3.2 : Constructor Definition

 
accessSpecifier ClassName(parameterType parameterName, . . .)
{
constructor body
}

Example:

 
public BankAccount(double initialBalance)
{
. . .
}

Purpose:

To define the behavior of a constructor


previous | start | next