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: 

creating more than one constructor in class

Former Member
0 Kudos

Hi experts,

I was trying to figure out whether is it possible to create more than one constructor in same class (like overloading in c++).

thank you.

2 REPLIES 2

former_member1245113
Active Contributor
0 Kudos

Hi,

I think there is a better way to express it anyways thanks to you too-:)

Technically speeking you can, but only the Inheritance Tree.
in one class Unique attributes (Variable) be declared in that sence, 
in a class we can have one Instance Constructor and one Static Constructor only

class lcl_class.
public section.
methods : constructor.
class-methods : class_constructor "Now no more duplicate declarations allowed
protected section

private section
endclass

"But if you inherit this class, the the Child class can have its own constructor
 "and when you call the child class constructor it must call its super class constructor

Cheerz

Check the below thread for more info

http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

Ram

Former Member
0 Kudos

Hi,

thanx for the info....now i'm clear with the doubt.......