posted 23 years ago
Q1)When you want to associate keys with values and you are using JDK1.2, which of the following classes are preferred?
a] Dictionary
b] HashTable
c] Properties
d] HashMap
e] TreeMap
answer given : d,e.
Q2)Which of the following are true about the following Vector
Vector v=new Vector (5,10)
a] Incorrect declaration
b] Initial capacity is 10 and capacity increment is 10
c] Initial capacity is 5 and capacity increment is 10
d] Initial capacity is 5 and capacity increment is 0
e] The default capacity increment of Vector is 10
Answer given : c,e.
Q3)If you want to read and evaluate expressions which of the following would you prefer?
a] Array
b] List
c] Vector
d] Stack
e] Map
Answer given : d.
Q4)Which of the following allows you to use null values?
a] HashSet
b] HashMap
c] HashTable
d] AbstractList
Answer given : a,b,d.
Q5)True or false?
a] Vector maintains their elements in insertion order
b] A Vector cannot expand more than its capacity
c] Vector provides only synchronized addition methods
d] Vectors holds only objects not primitives
Answer given : d.
Q6)Which of the following supports insertion, deletion and store growth very easier?
a] Array storage
b] Tree
c] Hashing
d] Linked List
Answer given : b,c,d.
Q7)Which of the following are true about BitSet
a] Individual bits cannot be examined, set or cleared.
b] The bit set will increase dynamically as needed to accommodate extra bits you add it.
Answer given : false, true.
Q8)Which of the following classes that are thread-safe?
a] HashMap and HashSet
b] Vector and HashSet
c] HashTable and Dictionary
d] Vector and HashTable
Answer given : d.