πŸ“Š JAVA
Q. What will be the output of the following code –
Code:
import java. util.Hashtable;
import java. util.Map;
public class hashTableBlog {
public static void main (String args[])
{
Map<Integer,String> hashtable = new Hashtable<Integer,String>();
hashtable.put(11,”a”);
hashtable.put(null,”c”);
hashtable.put(null,null);

System.out.println(hashtable.size());
System.out.println(hashtable);
}
}
  • (A) Runtime Exception
  • (B) Compile time exception
  • (C) 2 {11=bmw, null=fer}
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (A) Runtime Exception

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
208
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Uday Singh
Publisher
πŸ“ˆ
94%
Success Rate