Multiple Choice
Your program uses a Map structure to store a number of user ids and corresponding email addresses. Although each user must have a unique id, two or more users can share the same email address. Select an appropriate expression to complete the method below, which adds a new id and email address to the map only if the id is not already in use. If the id is already in use, an error message is printed. public static void addUserID(Map<String, String> users, String id, String email)
{
String currentEmail = users.get(id) ;
If (___________________)
{
Users.put(id, email) ;
}
Else
{
System.out.println(id + " is already in use.") ;
}
}
A) currentEmail.equals(email)
B) !currentEmail.equals(email)
C) currentEmail == null
D) currentEmail != null
Correct Answer:

Verified
Correct Answer:
Verified
Q79: Which of the following statements about manipulating
Q80: Assume you are using a doubly-linked list
Q81: What is included in a linked list
Q82: When using a list iterator, on which
Q83: Which nodes need to be updated when
Q85: Assume that you have declared a set
Q86: You use a(n) _ to access elements
Q87: You need to write a program to
Q88: Assume that you have declared a queue
Q89: Which of the following statements about stacks