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 5. Classes and Objects

5. Classes and Objects

As discussed in Chapter 1, object-oriented programming was introduced to let you handle bigger programming problems, letting you package programming components into easily remembered objects.

The example used in Chapter 1 was a refrigerator. Instead of starting the pumps, regulating the temperature, and starting the compressor yourself in open code, you wrap all those actions into an object containing data (such as the temperature) and methods (that is, functions, such as startCompressor()) into an easily remembered object: a refrigerator. You just put food in the refrigerator, and the refrigerator cools it for you; all the implementation details are hidden from view.


  

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


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