October 17th Bryan Bishop Summary of Key Concepts page 443 (Chapter 7) Inheritance is the process of creating a new class from an old one. Inheritance lets us reuse existing software. Inherited variables and methods can be used in the child class as if they had been declared locally. Inheritance creates an is-a relationship between all parent and child classes. Visibility modifiers determine which variables and methods are inherited. A parent's consturctor can be invoked using the super reference. A child class can override the parent's definition of an inherited method. The child of one class can be the parent of one or more other classes, creating a class hierarchy. Common features should be located as high in a class hierarchy as possible. All Java classes are derived, directly or indirectly, from the Object class. The toString and equals methods are defined in the Object class, so they are inherited by every class in every Java program. An abstract class cannot be instantiated. A class derivecd from an abstract parent must ovverride all of its parent's abstract methods, or the child class will also be considered abstract. All members of a superclass exist for a subclass, but they are not necessarily inherited. Only inherited members can be referenced by name in the subclass. A polymorphic reference can refer to different types of objects at different times. A reference variable can refer to any object created rfrom any class related to it by inheritance. A polymorphic reference uses the type of the object, not the type of the reference, to determine which version of a method to invoke. An interface name can be used to declare an object reference variable. An interface reference can rfer to any object of any class that implements that interface. interfaces let us make polymorphic references in which the method that is invoked is based on the object being referenced at the time. An applet is a good example of inheritance. The JApplet parent class handles characteristics that all applets have. The classesfor Java GUI components are organized into a class hierarchy. Moving the mouse and clicking the mouse button generate mouse events that a program can respond to. Rubberbanding is when a graphical shape seems to expand and contract as the mouse is dragged. A listener class can be created from an event adapter class.