I want to loop through the alphabet with a for loop and add each letter to my HashMap
for(char alphabet = 'A'; alphabet <= 'Z';alphabet++) {
System.out.println(alphabet);
}
doesn't work for me, because my HashMap
is of form
HashMap<String, HashMap<String, Student>> hm;
I need my iterator to be a string, but
for(String alphabet = 'A'; alphabet <= 'Z';alphabet++) {
System.out.println(alphabet);
}
doesn't work.
Basically, I want to do this:
for i from 'A' to 'Z' do
hm.put(i, null);
od
Any ideas?