What is the easiest way to create a HashMap like this :
( student1 => Map( name => Tim,
Scores => Map( math => 10,
physics => 20,
Computers => 30),
place => Miami,
ranking => Array(2,8,1,13),
),
student2 => Map (
...............
...............
),
............................
............................
);
I tried this :
HashMap record = new HashMap();
record.put("student1", new HashMap());
record.get("student1").put("name","Tim");
record.get("student1").put("Scores", new HashMap());
But I get error. I do it that way because, record.get("student1") is a HashMap object, so I assume a put on that should work, and so on.
If it doesnt work, what is the best way to do it ?