Java Reference
In-Depth Information
9.
On the far left of the Console view tool bar, click the Terminate button (the button has a
red box as an icon; see the arrow in Figure 3-5 ).
Figure 3-5.
The application will be ended and the Employee frame will disappear.
Specialization
Are you rested? This is going to get a little complicated, so you should be fresh and ready for some new, big concepts.
Besides relating many classes through composition (i.e., Employee is comprised of String , Frame , and Label
objects), a class can be related to another class through specialization (also referred to as “extending a class”). What
this means is that when you create a class, you define it as a specialized version of an already existing class.
For example, we could create a new class called EmpFrame and define it as an extension of the Frame class.
EmpFrame is now called a subclass of Frame , and Frame is called EmpFrame's superclass. The beauty and power of
specialization is that subclasses inherit all the capabilities (i.e., variables and methods) of their superclass.
Whoa, that was a mouthful. How do you feel? Do you need a glass of water?
 
Search WWH ::




Custom Search