quotes tell the computer that what’s in side them is text.
Leave out any de tail, and
nothing will work.
Another critical point about ob jects is that they can have parts. Think about
our phone book example. Think about what parts there are to a phone book. Here
are a few ex amples: the cover, pages, the blue pages (for gov ernment listings),
and the phone company in formation (such as how to contact the phone com pany
if your phone stops work ing). Each of these parts is its own ob ject (a particular
page might
be an ex ample of the class
Page
, or a range of pages might be an ex -
ample of the class
Pages
). You might access the phone
book by accessing a part
of the book. For example,
myPhoneBook.Pages.TurnToTheNextPage
might take the set of pages and turn them to the next one, so if you are on page
57, for example, you will find your self on page 59 (if the page is two-sided).
Now the dot is serving two purposes.
The first dot says that
Pages
is a part of the
ob ject
myPhoneBook
, and the second dot tells the com puter to do the thing (run
the method)
TurnToTheNextPage
, which is something that can be done to
Pages
.
While some parts of
an ob ject are other objects, some parts are properties.
For ex ample, a phone book has a color,
a number of pages, and a thickness. So
for ex ample, if I wanted to see how thick my phone book is, I might look at that
prop erty:
Do'stlaringiz bilan baham: