I\'ve got a class Results
which extends ArrayList
. I\'ve got an object i
which has a function i.getResults()
w
You have
Results extends ArrayList
So anywhere you might use ArrayList you can use Results, but not vice-versa. When you say extends you are saying I can do everything he can do, and a little bit more.
C extends D
says: if all you need is a D then you can use either a C or a D. But someone needing a C cannot accept a D, because it doesn have all the capabilities C offers.