...and the compiler will believe you. All will be well until the car object is a plain simple car and not a taxi.
I promise that whichever Car I “get()”from that list will be a Taxi
A few minutes ago, I wrote:. . . . The JVM will eventually find a fully‑implemented version . . . .
Ben Ernstberger wrote:I don't get what you mean with "break code".
Manish Pamnani wrote:SO it means i can inherit any number of subclasses from superclass?
Will there be no affect on running time of my program as it would have so many classes?
Execution speed should probably be the last consideration when designing an app. It is much more important to get the number of classes rright, and any inheritance hierarchy. It might be slightly slower to compile more classes, but that is the least of our worries.
Paul Clapham wrote:. . . But why would that matter?