I am basically trying to make a string consisting of all the values in my hashmap.
For example String finalOutcome = "forename=Bob&surname=Marl" and the hashmap would be:
Hashmap<String, String> maps = new Hashmap<String, String>();
maps.put("forename", forename);
maps.put("surname", surname);
My app/program keeps crashing when I am trying to add the values in my hashmap to get the finalOutcome. This is my code, and also how do I do it so that & sign does not come after the last value in the hashmap?? I pass this hashmap into another method in another class as follows:
public addMapValues(Hashmap<String, String> maps){
for(int i=0; i<maps.size(); i++){
finalOutcome += maps.get(i) + "&";
}
}
It's just that bit that is causing me a huge headache and I am sure someone here can fix this almost instantly (yes, I am not good with Java)
Would greatly appreciate some help