X hits on this document

169 views

0 shares

0 downloads

0 comments

16 / 46

© S. Uchitel, 2004

16

Reference Variables

Car myCar;

myCar = new Car(“Red”, “Fiat 600”, “25”);

What does “Car myCar;” do?

It creates a reference variable called myCar of type Car.

In other words, it creates a variable capable of referring to a Car object.

It does not create a Car object.

The variable is stored in the program stack

Document info
Document views169
Page views169
Page last viewedMon Jan 23 13:10:38 UTC 2017
Pages46
Paragraphs816
Words2901

Comments