120k views
5 votes
The java class library interface queue method to put an entey on the back of a queue that returns false if the method falls is

A. Add

B.put

C.poll

D.offer

User Marczych
by
5.0k points

1 Answer

3 votes

Answer:

(A) Add.

Step-by-step explanation:

The add method of queue inserts an element at the tail of the queue.

syntax:- queue.add(element);

It's return type is boolean it returns true if the insertion is successful and returns false if the insertion is unsuccessful and it returns an IllegalSpace Exception if there is no space left to insert an element in the queue.

User Itsundefined
by
4.8k points