89.0k views
0 votes
What is Inheritence in computer science? Explain in your won words with examples.

1 Answer

7 votes

Answer:

Inheritance is when one class or script, inherits the properties and methods of another class. They can be re-used which makes it useful. This is why there are parent classes and child classes. Child classes inherit the properties of the parent class. An example is when a "car", "truck" are subclasses of a class called vehicle. Allowing you to make more vehicle using the same parent class.

Hope this makes sense!

User Yogiginger
by
7.2k points