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 > Properties as Documentation

Properties as Documentation

In addition to their other virtues, properties serve as a form of documentation for your classes. They are more compact and more readable than the method declarations they replace, and they carry more information. They tell you if a property is read-only, something about how the property is stored, and whether its accessors are thread safe.

Look at the property declaration for the employeeNumber property in the Employee class:


  

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