developerinlondon
Programmer
I am trying to use a hashtable for storing various classes that needs to be passed as parameter from one class to another.
eg
any ideas how I can do this?
thanks
eg
Code:
class1 {
...
...
Connection connection = ...
HashTable params = new Hashtable();
params.put("data1",connection);
Class2 class2 = new Class2(params);
}
class2 {
private Connection connection;
...
this.connection = params.get("data1");
// or i tried the following that doesnt work either:
this.connection = (Connection)params.get("data1");
}
any ideas how I can do this?
thanks