In object-oriented programming, inheritance is the ability for one class to obtain all the data and contents from another class.