Scala Set takeRight() method with example

The takeRight() method is utilized to return a set consisting of last ‘n’ elements of the set. Method Definition: def takeRight(n: Int):Set[A] Where ‘n’ is… Read More »

Scala Queue dropWhile() method with example

The dropWhile() method is utilized to drop the longest prefix from the front which satisfies a given predicate in a queue. Method Definition: def dropWhile(p:… Read More »

Scala Queue +:() method with example

The +:() method is utilized to return a new queue with an element added at the front of the given queue. Method Definition: def +:[B… Read More »

Scala Queue +=() method with example

The +=() method is utilized to add an element at the back of a given queue. Method Definition: def +=(elem: A): Queue.this.type Return Type: It… Read More »

Scala Queue +=:() method with example

The +=:() method is utilized to add an element at the front of a queue. Method Definition: def +=:(elem: A): Queue.this.type Return Type: It returns… Read More »

Scala Queue ++=() method with example

The ++=() method is utilized to add element of a queue at the back of another queue. Method Definition: def ++=(xs: IterableOnce[A]): Queue.this.type Return Type:… Read More »

Scala Queue :+() method with example

The :+() method is utilized to return a new queue with an element added at the back of the given queue. Method Definition: def:+[B >:… Read More »

Scala Queue apply() method with example

The apply() method is utilized to find the element at any given index in a queue. Method Definition: def apply(idx: Int): A Return Type: It… Read More »

Scala Queue clear() method with example

The clear() method is utilized to delete all the elements of the queue. Method Definition: def clear(): Unit Return Type: It returns an empty queue.… Read More »

Scala Queue clone() method with example

The clone() method is used to create a copy of the given queue. Method Definition: defclone(): Queue[A] Return Type: It return a new queue which… Read More »

Scala Queue copyToArray() method with example

The copyToArray() method is utilized in copying the elements of the queue to an Array. Method Definition: def copyToArray[B >: A](xs: Array[B], start: Int, len:… Read More »

Scala Queue count() method with example

The count() method is utilized to count the number of elements in the queue that satisfies a given predicate. Method Definition: def count(p: (A) =>… Read More »

Scala Set last() method with example

The last() method is utilized to return the last element of the set. Method Definition: def last: A Return Type: It returns the last element… Read More »

Scala Set contains() method with example

The contains() method is utilized to check if an element is present in the set of not. Method Definition: def contains(elem: A): Boolean Return Type:… Read More »

Scala Set take() method with example

The take() method is utilized to return a set consisting of first ‘n’ elements of the set. Method Definition: def take(n: Int): Set[A] Where ‘n’… Read More »