Lecture 4
Box-and-arrow pictures
“Engulf and Devour”
int
200
int
200
BankAccount
balance:
BankAccount
balance:
Terminal
String
bankName:
Bank
BankAccount
account1:
BankAccount
account2:
Terminal
atm:
999
200
int
int
name of field
type (reference )
value
When value is an object, use an arrow to point to (refer
to) that object . When it’s
primitive it’s in the box.
value
type (primitive )
Strings are objects
value
name of field