Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
22 views
asked by Expert (15k points) 15 23 32

1 Answer

0 votes
You extend a class by creating a new class.
The former and the latter will then have a parent-child relationship.
The original class is the parent class or the base class or the superclass.
The new class is called a child class or a subclass or a derived class of the parent.
The process of extending a class in object-oriented programming is called inheritance.
In a subclass you can add new methods and new fields as well as override existing methods in the parent class to change their behaviors.
Inheritance gives you the opportunity to add some functionality that does not exist in the original class.
Inheritance can also change the behaviors of the existing class to better suit your needs.
The subclass and the superclass has an "is-a" relationship.
answered by Geek (15.3k points) 19 43 70

Related questions

0 votes
1 answer 21 views
21 views asked by john Guru (27.1k points) 35 53 115
0 votes
1 answer 55 views
55 views asked by sunny Expert (11.4k points) 16 23 32
0 votes
1 answer 37 views
0 votes
1 answer 8 views
8 views asked by taye Sr Member (5k points) 7 10 12
0 votes
1 answer 942 views
942 views asked by sara Guru (24.6k points) 32 59 94
...