previous | start | next

Syntax 2.2: Variable Definition

  TypeName variableName;
 TypeName variableName = expression;

Example:

  Rectangle cerealBox;
String name ="Dave";

Purpose:

To define a new variable of a particular type and optionally supply an initial value


previous | start | next