New answers tagged

0 votes

What is an example of class inheritance in every-day life which is easy to write in an object-oriented language?

This is a harder question than it seems if you want to get across the idea that a type hierarchy should contain variations but with the same interface. If the interface gets extended as you go down ...
  • 35.5k
2 votes

What is an example of class inheritance in every-day life which is easy to write in an object-oriented language?

I think that when dealing with new students the principle of inheritance is best explained with analogies to life outside of writing code. I'm not so sure. I prefer to use application-centric ...
  • 463
1 vote

What is an example of class inheritance in every-day life which is easy to write in an object-oriented language?

I've frequently used animals. They share some advantages over cups. First, there are a lot of them. Second, they already come pre-categorized into class trees thanks to hundreds of years of labor by ...
  • 32.2k

Top 50 recent answers are included