access to a protected variable of an object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Zeta_Kouper
Posted On:   Thursday, May 26, 2005 02:30 PM

Hello!I have a class with a Hashtable as a variable. I want all the other classses of the program to have access to the Hashtable (e.g. to put a new key, to find a key etc.) ,but I do not want to create a new instance of the class every time, I want to have only one object. (actually the class with the Hashtable implements a UDP socket and I want it to act as a server. I create an object of this class just once and I want some other classes to insert new members to this objects' Hashtable) If I use the object's name to acces the variale, I get an error Any suggestions ? Thank you !    More>>


Hello!I have a class with a Hashtable as a variable.


I want all the other classses of the program to have access to the Hashtable


(e.g. to put a new key, to find a key etc.)


,but I do not want to create a new instance of the class every time, I want to have only one object.


(actually the class with the Hashtable implements a UDP socket and I want it to act as a server.

I create an object of this class just once and I want some other classes to insert new members to this objects' Hashtable)


If I use the object's name to acces the variale, I get an error

Any suggestions ?

Thank you !

   <<Less

Re: access to a protected variable of an object

Posted By:   Shan_Thiruvarur  
Posted On:   Friday, May 27, 2005 01:34 AM

why dont you chane the access modifier to public in such case ?



can u send me the error that you get ?



let me try to interpret



HTH


vidhyasankar.natarajan@wipro.com
About | Sitemap | Contact