Slide 3 of 57
Lecture 2: Using Objects
Previous
Next
Overview
Syntax 2.1: Variable Definition
typeName variableName
=
value
;
or
typeName variableName
;
Example:
String greeting = "Hello, Dave!";
Purpose:
To define a new variable of a particular type and optionally supply an initial value