Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

poly

Former Member
0 Kudos

what is the exact meaning of polymorphism.While implementing the phenomenon of polymorphism by means of classes do the methods will belong to the same class or in different classses.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

1.Allows one interface to be used for a general class of actions.

2.When objects from different classes react differently to the same procedural call.

3.User can work with different classes in a similar way, regardless of their implementation.

4.Allows improved code organization and readability as well as creation of “extensible” programs.

5.Although the form of address is always the same, <b>the implementation of the method is specific to a particular class.</b>

Hope these clauses regarding POLYMORPHISM solve ur doubt..

Reward if helpful

2 REPLIES 2

Former Member
0 Kudos

1.Allows one interface to be used for a general class of actions.

2.When objects from different classes react differently to the same procedural call.

3.User can work with different classes in a similar way, regardless of their implementation.

4.Allows improved code organization and readability as well as creation of “extensible” programs.

5.Although the form of address is always the same, <b>the implementation of the method is specific to a particular class.</b>

Hope these clauses regarding POLYMORPHISM solve ur doubt..

Reward if helpful

Former Member
0 Kudos

Hi Sandeep,

Poly morphism in abap is handled sometimes only by Method overriding and in many cases by Method overriding and as well as casting .

We can not have methods with same name in a class in ABAP. I mean there is no method overloading in ABAP. Then you may ask me how polymorphism is possible ??. You can redefine a method in inherited classes. I mean method overriding. Now one method is existing with the same name but with 2 different implementations. Hence its poly morphism. Now once again the question is which implementation will be called ?? It depends upon the object which is calling the method. Depending the object which is calling the method implementation is called. <b>So Poly morphism in ABAP is achieved through method over riding.</b>

I have seen your different questions. Great .. Keep going in OOABAP. Its sexy.

If i find time i'll give you code samples as well.

Reward points if useful,

Aleem.