Message passing To understand the nature of objects, you must first understand how methods and data interact. Methods can be envisioned as wrapping around the data contained by an object, protecting it from the environment in which the object exists. In this way, the focus of programming shifts from thinking about data, to thinking about the various actions objects can perform. For example, it's very rare that object instance variables would be directly accessible by another object. Rather, special methods called accessor methods allow other objects to access variable values by invoking these methods that return the value of the instance variables.
Objects communicate with each other by sending messages.
You could think of an application as a network of objects that are constantly communicating with each other to serve the end purpose of the application. This metaphor is so powerful, in fact, that objects are often referred to as either servers or clients. Clients request services of server objects that provide the requested service. Inheritance One of the most important concepts of object-oriented programming is inheritance. The parent class is called a superclass and the new class is a subclass .