home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-12-14 | 740 b | 27 lines |
- import java.util.*;
-
- public class StudentIDMap
- {
- public static void main(String args[])
- {
- // Create the lists of failing students
- String[] SNames = {"Amy", "Jose", "Jeremy", "Alice", "Patrick"};
- String[] ID = {"123456789", "259879864", "988456997", "984876453", "9768696"};
-
- // Create the set to hold the failing students
- Map IDMap = new HashMap();
-
- //Add the failing students from each class to the set
- for (int i=0; i< SNames.length; i++)
- IDMap.put(ID[i],SNames[i]);
-
-
- //Print out the student list
- System.out.println(IDMap.size()+" Students entered: ");
- System.out.println(IDMap);
-
- }//Main
- }//StudentIDMap
-
-
-