Java - Online Test - Hashmap - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'hashmap' - 7 questions found


Which of the following collections stores its elements in insertion Order ?Core Java
HashMap
TreeMap
LinkedHashMap
LinkedMap

  linkedhashmap  collections  java  map

If we try to add duplicate key to the HashMap, What will happen ?Core Java
It will throw an exception.
It won't add the new Element without any exception.
The new element will replace the existing element.
Compiler will identify the problem and will throw an error.

  hashmap  map  collections  java

Which of the following is false ?Core Java
HashMap came before HashTable.
HashMap allows null values whereas Hashtable doesn’t allow null values.
HashTable and HashMap allow Key-Value pairs.
Hashtable is synchronized whereas HashMap is not.

  map  hashmap  hashtable  collection  java

Which of the collections allows null as the key ?Core Java
HashTable
HashMap
TreeMap
LinkedHashMap

  java  collections  map

Which keyword is used to provide explicit access of a code block to single thread ?Core Java
Transient
Final
Explicit
Synchronized

  java  threads  multithreading

Binary Search requires that the collection should beAlgorithm
Sorted in Ascending Order
Sorted in Descending Order
Sorted in any Order
Unsorted

  Binary Search  Search  Algorithm

Which of the following collections stores its elements in natural sorting order ?Core Java
HashMap
LinkedHashMap
TreeMap
EnumMap

  map  collections







comments powered by Disqus