欧美free性护士vide0shd,老熟女,一区二区三区,久久久久夜夜夜精品国产,久久久久久综合网天天,欧美成人护士h版

首頁綜合 正文
目錄

柚子快報激活碼778899分享:開發(fā)語言 后端 scala練習(xí)

柚子快報激活碼778899分享:開發(fā)語言 后端 scala練習(xí)

http://yzkb.51969.com/

需求一:wordCount

Scalapackage com.doit.day03import scala.io.{BufferedSource, Source}object WordCountDemo {

? def main(args: Array[String]): Unit = {

??? //讀取文件,獲取到一個Source對象??? val source: BufferedSource = Source.fromFile("D:\\develop\\ideaWorkSpace\\myself\\study\\scalaDemo\\data\\word.txt") ??? //調(diào)用getLines方法,獲取到每一行數(shù)據(jù),每一行數(shù)據(jù)都放在迭代器中??? val lines: Iterator[String] = source.getLines() ??? //如果我現(xiàn)在直接這么返回,他的返回值是什么???? Iterator[String]? ==》 同樣的返回一個迭代器,迭代器里面放得是Array[String] 數(shù)組里面每一個元素放得都是一個個的單詞??? val arrWord: Iterator[Array[String]] = lines.map(line => {

????? //1.需要將每一行數(shù)據(jù)拿出來進行切割,變成一個個的單詞????? //hello?? hadoop? hive????? val wordsArr: Array[String] = line.split("\\s+") ????? wordsArr ??? }) ??? //將迭代器轉(zhuǎn)換成了集合??? val list

柚子快報激活碼778899分享:開發(fā)語言 后端 scala練習(xí)

http://yzkb.51969.com/

參考文章

評論可見,查看隱藏內(nèi)容

本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。

轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。

本文鏈接:http://m.gantiao.com.cn/post/17819018.html

發(fā)布評論

您暫未設(shè)置收款碼

請在主題配置——文章設(shè)置里上傳

掃描二維碼手機訪問

文章目錄