{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture16 - Late binding Polymorphism via Inheritance...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Late binding Polymorphism via Inheritance Polymorphism via Interfaces The interface name, speaker, can be used to declare an object reference variable. Speaker guest = new Philospher(); The guest reference can be used to point to any object of any class that implements the Speaker interface The version of speak depends on the type of object that current is referencing guest.speak(); <Interface> Speaker Speak() Philosopher Speak() pontificate() Dog Speak()