Hey I have a quick question but HashMaps... Ok here is all the information that has to do with my HashMap:
Code:
public Map<Integer, String> sms = new HashMap<Integer, String>(5);
sms.put(0, "Welcome to Classic PimpScape PvP!");
sms.put(1, "Train in the training room, ancients is in the tab");
sms.put(2, "to the left of the frends list.");
sms.put(3, "Training takes 5 minutes at longest.");
sms.put(4, "Have Fun!");
sms.get(3);
for(String s : sms.values()) {
System.out.println(s);
}
What I'm doing here is trying to make make my client.java smaller by getting rid of unneeded text, so i created a HashMap. The question is would this work:
Code:
sendMessage(" + sms.get(0) + ");
So basically the
Code:
sms.put(0, "Welcome to Classic PimpScape PvP!");
would appear where I added the
Code:
sendMessage(" + sms.get(0) + ");
?
The reason I'm not trying it is because I'm at school and can't access my server files.