What is the example of inheritance in computer?

The purpose of inheritance is to consolidate and re-use code. For example, if the objects “car,” “truck,” and “motorcycle” are subclasses of vehicle, code applying to all of them can be consolidated into a vehicle superclass . The subclasses inherit this code and any future changes made to it, automatically.

Sizin İçin Seçtik  Holochain Ne projesi?

Leave a Reply

Your email address will not be published. Required fields are marked *