This chapter has conveyed the essential aspects of Java as an object-oriented language. Instance variables hold the state of a specific object. Objects communicate by sending messages to each other. Objects respond to messages by selecting a method to execute.
Methods define the behavior of objects instantiated from a class.
It is an object's methods that manipulate its instance variables. Unlike regular procedural languages, classes in an object-oriented language may have methods with the same names as other classes. A given object responds to a message in ways determined by the nature of that object, providing polymorphic behavior. Subclasses provide the means by which a new class can inherit instance variables and methods from any already defined class. Subclasses provide code reuse.