3.10. Summary

In this chapter, you've learned the following:

  • An object is a software abstraction of a physical or conceptual real-world object.

  • A class serves as a template for defining objects; specifically, a class defines the following:

    • What data the object will house, known as an object's fields

    • What behaviors an object will be able to perform, known as an object's operations (methods)

  • An object can then be thought of as a filled-in template.

  • Just as we can declare variables to be of simple predefined types such as int, double, and bool, we can also declare variables to be of user-defined types such as Student and Professor.

  • When we create a new object (a process known as instantiation), we typically store a reference to that object in a reference variable. We can then use that reference to communicate with the object.

  • We can define fields of a class A to serve as references to objects of another class B. In doing so, we allow each object to encapsulate the information that rightfully belongs to that object, but enable objects to share information by contacting one another whenever necessary.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset