X hits on this document

114 views

0 shares

0 downloads

0 comments

14 / 46

© S. Uchitel, 2004

14

Objects instantiation: Example

new Lecturer(“Alessandra Russo”, “ar3”);

Reserves space for a Lecturer in the heap

Creates fields and methods as described in Lecturer class.

Runs constructor with parameters “Alessandra Russo”  and “ar3” (Which stores these values in the corresponding fields)

Returns a reference to the new object in heap.

<<instanceOf>>

:Lecturer

name = “Alessandra”

login= “ar3”

setLogin(String):void

getLogin():String

Lecturer

name:String

login:String

setLogin(String):void

getLogin():String

Lecturer(name String, login String)

Document info
Document views114
Page views114
Page last viewedThu Dec 08 05:02:24 UTC 2016
Pages46
Paragraphs816
Words2901

Comments