polymorphism Archive

Polymorphism and Dynamic Method Lookup in Java

Polymorphism and dynamic method lookup are a powerful programming paradigm that simplifies client definitions, encourages object decoupling, and supports dynamically changing relationships between objects at runtime. According to Liang, Ploymorphism is : “An object of a subtype can be used wherever its supertype value is required. This feature is known as polymorphism” In above example

Inheritance in Java

Inheritance in java is very simple but userful and power ful. It allows us to extend existing class and reuse the existing code. The idea of extending class is very simple. If you want to write a class and a similar class already exist with less functionality or properties. You can extend the existing class