Scala Iterator addString() method with example Last Updated : 30 Jun, 2019 Comments Improve Suggest changes Like Article Like Report The addString() method belongs to the concrete value members of the class AbstractIterator. It is defined in the class IterableOnceOps. It is utilized to append the elements of the Scala Iterator to a String Builder. Method Definition : def addString(b: StringBuilder): StringBuilder Return Type : It returns the String Builder to which the elements were appended. Example #1: Scala // Scala program of addString() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating an Iterator val iter = Iterator(7, 6, 8, 1) // Applying addString method val result = iter.addString(new StringBuilder()) // Displays output println(result) } } Output: 7681 Example #2: Scala // Scala program of addString() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating an Iterator val iter = Iterator(7.7, 6.1, 8.6, 1.1) // Applying addString method val result = iter.addString(new StringBuilder()) // Displays output println(result) } } Output: 7.76.18.61.1 Comment More infoAdvertise with us Next Article Scala Iterator addString() method with example nidhi1352singh Follow Improve Article Tags : Scala Scala Scala-Method Similar Reads Scala Programming Language Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides support to the functional programming approach. Scala programs can convert to bytecodes and can run on the JVM (Java Virtual Machine). Scala stands for S 3 min read Learn Free Programming Languages In this rapidly growing world, programming languages are also rapidly expanding, and it is very hard to determine the exact number of programming languages. Programming languages are an essential part of software development because they create a communication bridge between humans and computers. No 9 min read Scala Tutorial â Learn Scala with Step By Step Guide Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides support to the functional programming approach. Scala programs can convert to bytecodes and can run on the JVM(Java Virtual Machine). Scala stands for Sc 15+ min read Introduction to Scala Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides the support to the functional programming approach. There is no concept of primitive data as everything is an object in Scala. It is designed to express 7 min read Scala | flatMap Method In Scala, flatMap() method is identical to the map() method, but the only difference is that in flatMap the inner grouping of an item is removed and a sequence is generated. It can be defined as a blend of map method and flatten method. The output obtained by running the map method followed by the f 4 min read For Loop in Scala In Scala, for loop is also known as for-comprehensions. A for loop is a repetition control structure which allows us to write a loop that is executed a specific number of times. The loop enables us to perform n number of steps together in one line. Syntax: for(w <- range){ // Code.. } Here, w is 6 min read Scala Console | println, printf and readLine Console implements functions for displaying the stated values on the terminal i.e, with print, println, and printf we can post to the display. It is also utilized in reading values from the Console with the function from scala.io.StdIn. It is even helpful in constructing interactive programs. Let's 2 min read Scala vs Java Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, etc. Java applications are compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. Scala is a general-purpose, high-level, multi-paradigm program 2 min read Hello World Program : First program while learning Programming In this article, I'll show you how to create your first Hello World computer program in various languages. Along with the program, comments are provided to help you better understand the terms and keywords used in theLearning program. Programming can be simplified as follows: Write the program in a 6 min read How to Install Scala with VSCode? Scala is a multi-paradigm, general-purpose, high-level programming language. It is an object-oriented programming language that also supports functional programming and it is easy to use. Its applications can be converted to bytecodes and executed on the Java Virtual Machine (JVM) (Java Virtual Mach 2 min read Like