Objects and Collections on Java related Questions and Answers

Question 1 : What is the numerical range of char?
1. 0 to 32767
2. 0 to 65535
3. -256 to 255
4. -32768 to 32767
View Answer   Discuss with Members

Question 3 : Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?
1. java.util.SortedMap
2. java.util.TreeMap
3. java.util.TreeSet
4. java.util.Hashtable
View Answer   Discuss with Members

Question 4 : Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?
1. java.util.ArrayList
2. java.util.LinkedHashMap
3. java.util.HashMap
4. java.util.TreeMap
View Answer   Discuss with Members

Question 5 : Which interface provides the capability to store objects using a key-value pair?
1. Java.util.Map
2. Java.util.Set
3. Java.util.List
4. Java.util.Collection
View Answer   Discuss with Members

Question 6 : Which interface does java.util.Hashtable implement?
1. Java.util.Map
2. Java.util.List
3. Java.util.HashTable
4. Java.util.Collection
View Answer   Discuss with Members

Question 7 : You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?
1. java.util.Map
2. java.util.Set
3. java.util.List
4. java.util.Collection
View Answer   Discuss with Members

Question 8 : Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?
1. java.util.HashSet
2. java.util.LinkedHashSet
3. java.util.List
4. java.util.ArrayList
View Answer   Discuss with Members

Question 9 : Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
1. java.lang.String
2. java.lang.Double
3. java.lang.StringBuffer
4. java.lang.Character
View Answer   Discuss with Members

Question 10 : Suppose that you would like to create an instance of a new Map that has an iteration order that is the same as the iteration order of an existing instance of a Map. Which concrete implementation of the Map interface should be used for the new instance?
1. TreeMap
2. HashMap
3. LinkedHashMap
4. The answer depends on the implementation of the existing instance.
View Answer   Discuss with Members


View 1 - 10 of 10 Questions

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter