随笔分类 -  Scala

摘要:解决方法:1)Copy winutils.exe from here(https://github.com/steveloughran/winutils/tree/master/hadoop-2.6.0/bin) to some folder say, C:\Hadoop\bin. Set HADO 阅读全文
posted @ 2018-10-18 22:10 chenzechao 阅读(792) 评论(0) 推荐(0) 编辑
摘要:# Scala数据类型 ## 1.数值类型 ### 1.1 与Java一样Scala也有8种数值类型 * Byte * Char * Short * Int * Long * Float * Double * Boolean ### 1.2 其它数值类型 * BigInt = java.math.B 阅读全文
posted @ 2018-04-19 17:54 chenzechao 阅读(747) 评论(0) 推荐(0) 编辑
摘要:package scala/** * Created by EX-CHENZECHAO001 on 2018-04-04. */class Chapter13 { // 13 集合 // 所有的集合都扩展自Iterable特质 // 集合有三大类,分别为序列、集和映射 // 对于几乎所有集合类,Sc 阅读全文
posted @ 2018-04-04 18:02 chenzechao 阅读(127) 评论(0) 推荐(0) 编辑
摘要:package scalaimport java.awt.event.{ActionEvent, ActionListener}import javax.swing.JButtonimport scala.math._/** * Created by EX-CHENZECHAO001 on 2018 阅读全文
posted @ 2018-04-04 15:12 chenzechao 阅读(122) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2018-04-04 00:06 chenzechao 阅读(1) 评论(0) 推荐(0) 编辑
摘要:package scalaimport java.io.{PrintStream, PrintWriter}import java.util.Dateimport scala.util.logging.{ConsoleLogger, Logged}/** * Created by EX-CHENZE 阅读全文
posted @ 2018-04-03 17:24 chenzechao 阅读(189) 评论(0) 推荐(0) 编辑
摘要:package scalaimport scala.collection.mutable/** * Created by EX-CHENZECHAO001 on 2018-04-03. */class Chapter11 {}object Chapter11 {// 标识符由字母、数字或运算符构成/ 阅读全文
posted @ 2018-04-03 17:24 chenzechao 阅读(295) 评论(0) 推荐(0) 编辑
摘要:import java.io.File import java.nio.file._ import scala.collection.mutable.ArrayBuffer/** * Created by EX-CHENZECHAO001 on 2018-04-02. */class Chapter 阅读全文
posted @ 2018-04-02 18:03 chenzechao 阅读(139) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2018-03-30 16:57 chenzechao 阅读(134) 评论(0) 推荐(0) 编辑
摘要:/** * Created by EX-CHENZECHAO001 on 2018-03-30. */class Chapter06 {}// 6 对象// 用对象作为单例或存放工具的方法// 类可以拥有一个同名的伴生对象// 对象可以扩展类或物质// 对象的apply方法通常用来构造伴生类的新实例 阅读全文
posted @ 2018-03-30 16:49 chenzechao 阅读(143) 评论(0) 推荐(0) 编辑
摘要:// 5.7 主构造器// 主构造器的参数直接旋转在类名之后class Person57(val name: String, val age: Int) { // 上边()中的内容就是主构造器的参数}class Person57_01(val name: String) { var age = 0 阅读全文
posted @ 2018-03-30 16:48 chenzechao 阅读(121) 评论(0) 推荐(0) 编辑
摘要:import scala.collection.mutable.ArrayBuffer/** * Created by EX-CHENZECHAO001 on 2018-03-29. */class Chapter03 {}object Chapter03 { // 3.5 常用算法 val arr 阅读全文
posted @ 2018-03-29 18:05 chenzechao 阅读(194) 评论(0) 推荐(0) 编辑
摘要:/** * Created by EX-CHENZECHAO001 on 2018-03-29. */class Chapter05 {}// 类// 类中的字段自动带有getter方法和setter方法// 5.1 简单类和无参方法class Counter { private var value 阅读全文
posted @ 2018-03-29 18:04 chenzechao 阅读(117) 评论(0) 推荐(0) 编辑
摘要:// 2.1 条件表达式val x = 2val s = if (x > 0) 1 else -1if (x > 0) "positive" else -1// 返回值类型不一致,无法确定返回值的类型,所以返回Any类型// 2.2 语句终止var n = 2var r = 0if (n > 0) 阅读全文
posted @ 2018-03-28 18:08 chenzechao 阅读(194) 评论(0) 推荐(0) 编辑
摘要:// 4.1构造映射val scores = Map("Alice" -> 10, "Bob" -> 3, "Cindy" -> 8) // 不可更改值val scoresMu = scala.collection.mutable.Map("Alice" -> 10, "Bob" -> 3, "Ci 阅读全文
posted @ 2018-03-27 14:01 chenzechao 阅读(147) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2017-10-14 23:21 chenzechao 阅读(474) 评论(0) 推荐(0) 编辑
摘要:HADOOP_USER_NAME=hadoop 阅读全文
posted @ 2017-07-27 22:37 chenzechao 阅读(151) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2017-06-25 18:25 chenzechao 阅读(1) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示