X hits on this document

103 views

0 shares

0 downloads

0 comments

17 / 46

© S. Uchitel, 2004

17

Object Instantiation - Summary

int a = 4;

Car myCar;

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

4

a

Heap

Stack

model = “Fiat 600”

fuelCapacity = 25

colour = “Red”

start():void

stop():void

move(direction:String):void

Creates a new Car object and runs constructor.

myCar

Creates a new reference variable of type Car in Stack

Assigns a reference of the object to the variable.

Document info
Document views103
Page views103
Page last viewedMon Dec 05 09:15:45 UTC 2016
Pages46
Paragraphs816
Words2901

Comments