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: 

constructor

Former Member
0 Kudos

Is constructor overloading or construtor overriding possible.If so how.Can the constructor of super class redefined in subclasses.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sandeep,

Constructor overloading is not there in abap. As a matter of fact Overloading concept is not there in abap.

Overriding is there. In a constructor of sub class you can call super class constructor by using SUPER->constructor.

I dont have time now.. otherwise i would have given u code.

If u need it just give a reply....Reward points .

Aleem.

3 REPLIES 3

Former Member
0 Kudos

Hi

One of the use of calling constructor of super class in a subclass is while before calling the constructor of subclass if you want to access the methods,or if u want to handle any data/information of a super class in a subclass u can call the consttructor of superclass. but i dont think we can redefine the constructor of superclass in subclass

Former Member
0 Kudos

Hi Sandeep,

Constructor overloading is not there in abap. As a matter of fact Overloading concept is not there in abap.

Overriding is there. In a constructor of sub class you can call super class constructor by using SUPER->constructor.

I dont have time now.. otherwise i would have given u code.

If u need it just give a reply....Reward points .

Aleem.

lokesh_kamana
Active Contributor
0 Kudos

hi sandeep,

Constructor overloading is not their in ABAP since we are using the same name constructor in every class.So that a conflict occurs while recognising the name.

so that is not in a state to recognize that method.

however constructor overriding is possible.

It means nothing but we are redefining the method in the sub class.

if want the code i will send u that will expalin .

Otherwise you go for ABAPDOCU-tcode.u can get clear examples in that.

WITH REGARDS,

Lokesh@EDS