As I know, we can make the Queue
by using the LinkedList<>()
class.
But, when I try to add the ArrayList<Integer>
element into the Queue, it doesn’t working.
So, I was finding the two of solutions to fix this issue.
- Use
Queue<ArrayList<Integer>>
instead ofQueue<Integer>
- Use
Queue<Integer>
and add the ArrayList byQueue.addAll()
Please, tell me the best answer.
Thanks.
New contributor
serie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.