import java.util.HashMap;
import java.util.Map;
public class MainClass {
public static void main(String args[]) {
String[] names = { "A", "J", "B", "E", "P" };
String[] ids = { "1", "2", "9", "8", "7" };
Map IDMap = new HashMap();
for (int i = 0; i < names.length; i++)
IDMap.put(ids[i], names[i]);
System.out.println(IDMap.size() + " Students entered: ");
System.out.println(IDMap);
}
}
5 Students entered:
{7=P, 2=J, 9=B, 8=E, 1=A}