HashMap savedStuff = new HashMap(); savedStuff.put(\"symbol\", this.symbol); //this is a string savedStuff.put(\"index\", this.index); //this is an int
You need to use generics as shown below :
Map savedStuff = new HashMap();