Durga Gadiraju

Tuples

Let us see tuples in detail A tuple is another data structure in Scala It can hold heterogeneous elements Syntax for tuple val t = (1, “Hello World”) Another syntax for tuple val t: (Int, String) = (1, “Hello World”) Tuple has a handful of methods Elements of tuples can be accessed using _ notation (t._1 will return 1 and t._2 return Hello …

Tuples Read More »

Basic I/O Operations and using Scala Collections APIs

As part of this topic, we will explore Basic I/O operations Read data from files Convert into collection Perform collection operation to preview the data Run map-reduce operations Reading data from files To read files from a file system in scala there is a package called scala.io In scala.io we have a package named Source which …

Basic I/O Operations and using Scala Collections APIs Read More »