“Java includes inheritance, or the ability to derive new classes from existing classes. The derived class, also called a subclass, inherits all the data and functions of the existing class, referred to as the parent class. A subclass can add new data members to those inherited from the parent class. As far as methods are concerned, the subclass can reuse the inherited methods as is, change them, and/or add its own new methods. For example, the subclass VerbosePerson could be derived from the class Person, with the difference between instances of the Person class and instances of the VerbosePerson class being the way they identify themselves. The following code creates the subclass VerbosePerson and changes only the implementation of the method identifySelf:”
―
C, C++ and Java Questions and Answers
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
0 likes
All Members Who Liked This Quote
None yet!
This Quote Is From
Browse By Tag
- love (100819)
- life (79000)
- inspirational (75459)
- humor (44145)
- philosophy (30749)
- inspirational-quotes (28664)
- god (26803)
- truth (24615)
- wisdom (24406)
- romance (24242)
- poetry (23100)
- life-lessons (22315)
- quotes (20635)
- death (20480)
- happiness (18916)
- hope (18426)
- faith (18282)
- inspiration (17214)
- spirituality (15616)
- travel (15609)
- relationships (15376)
- religion (15329)
- motivational (15235)
- life-quotes (15189)
- love-quotes (15043)
- writing (14892)
- success (14120)
- motivation (13075)
- time (12795)
- science (12025)