on 05-14-2012 11:40 AM
hi can any one tell me in se24 Instantiation option
what is the meaning of -- public
Protected
private
abstarct
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 :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.