Solved

Complete the Following Code, Which Is Intended to Print Out

Question 102

Multiple Choice

Complete the following code, which is intended to print out all key/value pairs in a map named myMap that contains String data for student IDs and names: Map<String, String> myMap = new HashMap<String, String>() ;
) . .
_______________________________
For (String aKey : mapKeySet)
{
String name = myMap.get(aKey) ;
System.out.println("ID: " + aKey + "->" + name) ;
}


A) Map<String, String> mapKeySet = myMap.keySet() ;
B) Set<String, String> mapKeySet = myMap.keySet() ;
C) Set<String> mapKeySet = myMap.getKeySet() ;
D) Set<String> mapKeySet = myMap.keySet() ;

Correct Answer:

verifed

Verified

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

Related Questions