How to make use the same Hashtable?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sa_Sche
Posted On:   Monday, December 10, 2001 08:10 PM

I have a program 'class', which uses a Hashtable to "store" informations. This Hashtable is declared static.

If I write in main of this program:

class c1 = new class() and class c2 = new class(), then both work with the same Hashtable.
Now I have written a test-program, with input/output to test class. It should now works, that I can open test f.e. twice and both work with the same Hashtable. But it doesn't works so. Both get a new Hashtable.
Could somebody help me, and explain how I could synchronize that?
Thank you.

Re: How to make use the same Hashtable?

Posted By:   rodney_tgdsoro1  
Posted On:   Tuesday, December 18, 2001 09:25 AM

It's hard to figure out what you've done but if the hashtable is defined static there is only one Hashtable for that specific class. Over time it might not be the same any more because you overwrite it at a later point in time without checking if it it isn't null anymore.
some code could help
About | Sitemap | Contact