예제 #1
0
 protected static void addContact(UserID user, Scanner scan) {
   assert (user != null);
   System.out.println("Please enter username of the user you want to add: ");
   String username = scan.next();
   UserID userAboutToAdd = registeredUsers.get(username);
   if (userAboutToAdd != null) {
     user.addContact(username);
     System.out.println("Contact added.");
   } else System.out.println("Contact cannot be added, check make sure username is correct");
 }