views:

51

answers:

2

it'll be used to key-map String-Object value. let's say, myObject = struct.get("first"); ordering is not important.

parameterized Hashset or anything better?

if that doesn't bother you, can you give me an example of static initialization along with the declaration, of a simpler structure, eg (String-String key mapping)?

+4  A: 

HashMap<String, Object> is the way forward.

Paolo
+1 for the answer
Padmarag
+1  A: 

It depends if your object needs to be threadsafe or not. If thread safety is not a concern, HashMap is what you want. If thread safety is required, you can go with ConcurrentHashMap.

private static ConcurrentHashMap<String, Object> myMap = new ConcurrentHashMap<String,Object>();
Luhar