Lecture 7
16
How References Work
h1 = h0;
h0.setLength(9);
Variables
h0
and
h1
refer to the
same
HLine instance
The HLine referred to by
h1
sees the change since its
the same HLine
h0:
h1:
HLine
paintChar:
9
x
length:
int
char
HLine
HLine