‎2008 Mar 25 12:50 PM
Hello,
Is there any way that i can access the methods of a class that are defined in its PRIVATE section.
Pointers for the same woudl be appreciated.
Thanks!!
Jai...
‎2008 Mar 25 12:58 PM
Hi,
Private Methods of a class.. it cannot be called directly. It can only be called by the public methods of the class.
had your reqmt is possible, then the whole concept of encapsulation fails.
hope this helps.
Thanks
Balaji
‎2008 Mar 25 12:58 PM
Hi,
Private Methods of a class.. it cannot be called directly. It can only be called by the public methods of the class.
had your reqmt is possible, then the whole concept of encapsulation fails.
hope this helps.
Thanks
Balaji
‎2008 Mar 25 1:51 PM
Look for public methods, typically named "GET_attribute" or "SET_attribute" (getters and setters), that provide the values of private attributes. Sometimes you might find a method that returns the attribute you're interested in, in a structure, or another object.
However, if the programmer of the class hasn't provided access in such a way, you can't get at the data.
matt
‎2008 Mar 25 4:34 PM
hi,
Components that you declare in the private section are only visible in the methods of the same class. The private components are not part of the external interface of the class.
so, the methods that are declared in the private section cannot be accesed.
rewards if usefull.