What is an Object?
- An object is another way of representing compound data, as in a struct or record.
- Like a struct, it has fields.
-
An object has one built-in field, called
this
, which always refers to this object. - Here are pictures of two simple objects:
x = 10
y = 20
r = 14
this =
h = 30
w = 15
color = "blue"
this =
We assume you've seen some kind of object-oriented programming before, so we're just reviewing vocabulary here.
If you have never used OOP before, go do some outside reading before continuing.