Today is the second day to learn Liaoliang teacher Big data, today is mainly about the basic knowledge of Scala, the following begins the development of Scala tour.
Tuple use
Print out the contents of the triple
Array uses
Array is similar to the use of arrays in Java, but the way of traversal is somewhat different
One of the above traversal methods is equivalent to the following traversal, and the output is the same.
Map using
In contrast to Map,scala in Java, map is also made up of key,value, unlike map traversal in some different ways
Scala file Operations
I: Read File contents
After running, the contents of the Scala.txt file will be output in the console
II: Reading content from a Web page
III: Write file contents
In this section, we mainly learn Tuple,array, Map and file operation and other content, and Java in the Array,map file operation and other content is relatively similar, when you learn, you can learn Java ideas to learn Scala.
Scala Project Development Combat (2)