Code with Finding: |
class SocialNetworkAdmin {
public static String displayGroupList(Connection conn, Map<Integer, String> groupList, String newUser) {
String list = "";
if (groupList == null || groupList.size() == 0) {
list = EMPTY_LIST;
} else {
Iterator<Entry<Integer, String>> it = groupList.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Integer, String> pairs = (Map.Entry<Integer, String>)it.next();
list += "print " + pairs.getKey() + " " + pairs.getValue() + ";";
}
}
return "print Choose a cappella group for " + newUser
+ " by entering the group number:;" + list + "askForInput;";
}
}
|