Solved

Your Program Uses a Map Structure to Store a Number

Question 100

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.Assuming that all entries in the map have valid email addresses, 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. 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.Assuming that all entries in the map have valid email addresses, 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.    A) !currentEmail.equals(email)  B) currentEmail.equals(email)  C) currentEmail != null D) currentEmail == null


A) !currentEmail.equals(email)
B) currentEmail.equals(email)
C) currentEmail != null
D) currentEmail == null

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions