Scala Stack toBuffer() method with example
In Scala Stack class, the toBuffer() method is utilized to return a buffer consisting of all the elements of the stack. Method Definition: def toBuffer[B >: A]: Buffer[B] Return Type: It returns a buffer consisting of all the elements of the stack. Example #1: Scala // Scala program of toBuffer()