Loading…

What is the difference between Stack and Queue?

  Stack Queue
1. Objects accessed on Last In First Out (LIFO). Objects accessed on First In First Out (FIFO)
2. Object pushed on top of collection Object inserted at the end
3. Object removed from the top Object removed from the beginning.
4. Two operations are called push and pop Two operations are called enqueue and dequeue

Suggest An Answer

No suggestions avaliable!

Latest post from Java interview questions

Ask Question