This class has two ivars (width and height).
We want to access the ivars for use.
Ivars are generally private so access would only be by the object that owns them.
Accessing ivars is done similarily to sending messages.
We have a general pattern we can always use to access an ivar:
target-dot-ivar
Syntax may vary slightly between programming languages.
Here is a pattern for accessing ivars:
<target><dot><ivar>
It is very similar to our previous pattern for sending messages:
<target><dot><msg>()
target = the target (receiver) object owning the ivar
dot = .
msg = the ivar name
Using
"target-dot-ivar" we write code to access an ivar:
this.width
Where:
target = "this"
dot = .
ivar = "width"