cancel
Showing results for 
Search instead for 
Did you mean: 

se24 Instantiation option

ravi_kumar221
Participant
0 Kudos

hi can any one tell me in   se24 Instantiation option

   what is the meaning   of  -- public

                                           Protected

                                          private

                                         abstarct 

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ..

while crreating class there two steps ...

1 create class definition

2 implement that class..

coming to meaning of

Public : methods can be accesed in current class and by its sub class and outside the class.

protected : methods can be accesed by itself aswell as its sub class only.

private : methods can be accesed by itself only..

    Note : private methods are accesed by using friend key word..

for reference :

  http://saptechnical.com/Tutorials/OOPS/Visibility/Index.htm

for difference between public protected and private ...

http://scn.sap.com/thread/812861

to know how to acces private methods :

http://scn.sap.com/thread/818595

Former Member
0 Kudos

Hi Ravi,

When we create a class we cannot directly access it.

we have to create a reference variable of type class and then create object using the reference variable.This process is called instantiation.

Public-Means Methods/variables of this class can be accessed anywhere outside the class.

Private-Attributes/methods of this class can be accessed only within the class and cannot be accessed anywhere else.

Protected-Attributes/Methods of this can be accessed within the class and in the child class.

Abstract-these classes does not contain any instances to that class objects

we can define some common functionalities in abstract class(super class) and those can be used in derived classes(Sub-classes)

Thanks,

Glory