SURAJ LUMS EDU
Handout 51 Programming - 2 Umair Javed BTE Inheritance What is Inheritance? A process by which a class can extend another class, inheriting all its variables, methods, while redefining (overriding) some of them, and/or adding its own. Thus inheritance promotes code re-use. If a class "B" needs to define some behavior and a lot of that behavior is pre-defined in any other class "A" then instead of defining the entire behavior again, the class "B" should inherit from that class "A". An Example Inheritance allows classes to be defined in terms of other classes MoreKeyword extends is used for defining inheritance between super and sub class as the subclass is extending the behavior and functionality of superclass. ... Less
Not the form you were looking for?
Upload form
Not the form you were looking for?
Upload form
Please wait while form is uploaded and processed.
After you finish filling the form, you can Print, Email or Export your form. |
|