Skip to Content

se24 Instantiation option

hi can any one tell me in   se24 Instantiation option

   what is the meaning   of  -- public

                                           Protected

                                          private

                                         abstarct 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 14, 2012 at 11:07 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 14, 2012 at 11:12 AM

    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

    Add comment
    10|10000 characters needed characters exceeded