The buffered() method in Scala belongs to the concrete value members of the class iterator of Scala. It creates a buffered iterator from the iterator stated.
- Method Definition:
def buffered: BufferedIterator[A]
- Return Type:
It returns a buffered iterator which produces the alike values as the stated iterator.
Here, a buffered iterator of the stated iterator is returned after applying buffered method.
Here, the stated iterator is empty so, an empty buffered iterator is returned after applying buffered method.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.