Loading

Q1.

Which principle does a Queue in Java follow?

A. LIFO (Last In First Out)

B. FIFO (First In First Out) 

C. Random Order

D. Priority Based

Q2.

Which Java interface defines the Queue?

A. Collection

B. Iterator

C. Queue 

D. List

Q3.

 Which of the following classes implements the Queue interface?

A. ArrayList

B. LinkedList 

C. HashSet

D. TreeMap

Q4.

Which method retrieves and removes the head of the queue, or returns null if empty?

A. remove()

B. peek()

C. poll() 

D. element()

Q5.

 Which type of queue gives priority to elements based on natural ordering or comparator?

A. Deque

B. PriorityQueue 

C. LinkedList Queue

D. BlockingQueue