Concept of Polymorphism in ABAP Objects

Go down

Concept of Polymorphism in ABAP Objects

Post  Uma_ABAP on Sun Apr 01, 2012 1:25 pm

Polymorphism refers to the property by which objects belonging to different classes are able to respond to the same message, but in different forms, an essential requirement of polymorphism is the ability to refer to objects without any regard to their class.
This necessitates the use of a single reference variable to refer to the object of different class. For example consider two classes, say scooter and bike, both the scooter and bike have a method called engine_power, and the method is implemented differently in different class. The concept of polymorphism says that we should have a common point of access to the method engine _power implemented differently. Now the question comes how do we achieve polymorphism.

The concept of polymorphism can be shown through inheritance as well as
interface.

Uma_ABAP

Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum