Data Structures
- What is the unique feature of LinkedHashSet?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Set is a collection of unique elements.HashSet has the behavior of Set and stores key value pairs. The LinkedHashSet stores the key value pairs in the order of insertion.
- Which of the below is not a subinterface of Queue?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
BlockingQueue, TransferQueue and BlockingQueue are subinterfaces of Queue.
- What is the remaining capacity of BlockingQueue whose intrinsic capacity is not defined?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
A BlockingQueue without any intrinsic capacity constraints always reports a remaining capacity of Integer.MAX_VALUE.
- PriorityQueue is thread safe.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
PriorityQueue is not synchronized. BlockingPriorityQueue is the thread safe implementation.
- What is difference between dequeue() and peek() function of java?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
dequeue() removes the item next in line. peek() returns the item without removing it from the queue.