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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 12. Properties > Accessing Instance Variables Outside of an Object (Don...

Accessing Instance Variables Outside of an Object (Don’t Do It)

Assume you’ve been asked to build a part of a business system that tracks a company’s employees. Start with a very simple model of an employee that stores the employee’s name, ID number, supervisor, and salary.

Listing 12.1 shows an Employee class that declares instance variables to hold this information.


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial