What is inheritance in object-oriented programming?

Inheritance is a useful and powerful concept in object-oriented programming languages, such as Java and C++. Inheritance is used to provide subclasses with the same instance variables and operations as the superclass they inherit from. Subclasses have an “is a” relationship with the classes they inherit, for example, a Rabbit class would inherit from an Animal class and would inherit all standard animal behaviour; however, the class would also add additional rabbit specific functionality to its own class.

Related Computing University answers

All answers ▸

Write a recursive binary search algorithm in pseudocode.


Given two strings s1 and s2 return the location of each permutation of the s1 string within the s2 string.


Find a given element m in a list of n sorted numbers, with time complexity O(log(n))


What is the purpose of RAM in a computer?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy