Which method is preferred over `add()` to avoid exceptions when inserting?
Correct answer
offer()
Explanation
`offer()` returns false instead of throwing an exception if the queue is full.
Update: Admin added a tag on this question
Topics
By Admin · · 25 views