Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Dots to Members

So far, we’ve looked at literal expressions and operators that look (more or less) like the equations you remember from school. But there’s a very important kind of expression that is hardly recognizable as one. It’s called MEMBER ACCESS (the fields, properties, methods and events of a class are called its members), and the operator is a period “.”, commonly referred to as the “dot operator”.

image

On Your Own

image

Here’s the class diagram from the previous page. Using the dot operators, write the expression (not a statement) to access each of its properties.

image


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint