Question: what is the difference between poll() and remove() method of queue interface?
Answer: Both poll() and remove() method is used to remove head object of the Queue. The main difference lies when the Queue is empty(). If Queue is empty then poll() method will return null . While in similar case , remove() method will throw NoSuchElementException .