Scala Queue contains() method with example
The contains() method is utilized to test if an element is present in the queue or not.
Method Definition: def contains[A1 >: A](elem: A1): Boolean
Return Type: It returns true if the element is present in the queue, else it returns false.
Queue(10, 11, 12, 13, 14) Queue contains 12: true
Queue(10, 11, 12, 13, 14) Queue contains 20: false