previous
|
start
|
next
Constructing Objects
new Rectangle(5, 10, 20, 30)
Detail:
The
new
operator makes a
Rectangle
object
It uses the parameters (in this case,
5
,
10
,
20
, and
30
) to initialize the data of the object
It returns the object
Usually the output of the new operator is stored in a variable
Rectangle box = new Rectangle(5, 10, 20, 30);
previous
|
start
|
next