0

I have a mutable queue.

import scala.collection.mutable._
var queue = new Queue[Component]();

I am trying to remove the last component:

val comp = queue.pop();

However, I am getting the following error:

error: value pop is not a member of scala.collection.mutable.Queue[Solution.Component]

How can I remove the last element?

1 Answer 1

4

You are looking for dequeue method:

val comp = queue.dequeue
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.