X hits on this document

111 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 views111
Page views111
Page last viewedTue Dec 06 22:40:09 UTC 2016
Pages46
Paragraphs816
Words2901

Comments