A
Q. What will be the output of given code
Code:
import java.util.HashMap;
import java.util.Map;
public class MyClass
{
public static void main(String args[])
{
Map<String,String> hashMap = new HashMap<String,String>();
hashMap.put(new String(“a”),”audi”);
hashMap.put(new String(“a”),”ferrari”);
System.out.println(hashMap);
}
}
import java.util.Map;
public class MyClass
{
public static void main(String args[])
{
Map<String,String> hashMap = new HashMap<String,String>();
hashMap.put(new String(“a”),”audi”);
hashMap.put(new String(“a”),”ferrari”);
System.out.println(hashMap);
}
}
- Correct Answer - Option(D)
- Views: 7
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.