Vidyalelo
Java Programming · Q20

Java Collections Framework

Programming · Java Programming · question 20

Q20

What is the primary difference between a `Stack` and a `Queue` in the Java Collections Framework?

A.
A `Queue` allows duplicate elements, while a `Stack` does not
B.
A `Stack` allows duplicate elements, while a `Queue` does not
C.
A `Queue` uses a LIFO order, while a `Stack` uses a FIFO order
D.
A `Stack` uses a LIFO (Last-In-First-Out) order, while a `Queue` uses a FIFO (First-In-First-Out) order
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board