Reading File Content:

Reading from files is really simple. You can use Scala's Source class and its companion object to read files. Following is the example which shows you how to read from "test.txt" file which we created earlier: