Sail E0 Webinar
Question


What is the output of this program?


import java.util.*;
class hashtable {
public static void main(String args[]) {
Hashtable obj = new Hashtable();
obj.put("A", new Integer(3));
obj.put("B", new Integer(2));
obj.put("C", new Integer(8));
obj.remove(new String("A"));
System.out.print(obj);
}
}
Options:
A .  {C=8, B=2}
B .  [C=8, B=2]
C .  {A=3, C=8, B=2}
D .  [A=3, C=8, B=2]
Answer: Option B

None.
Output:
$ javac hashtable.java
$ java hashtable
{C=8, B=2}



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers