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.

RF
Answered by Ryan F. Computing tutor

1725 Views

See similar Computing University tutors

Related Computing University answers

All answers ▸

What is the purpose of RAM in a computer?


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


Write a recursive binary search algorithm in pseudocode.


What is polymorphism in regards to Object Oriented Programming (OOP)? Provide an example.


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–2025

Terms & Conditions|Privacy Policy
Cookie Preferences