2021年1月31日
摘要: trait object Test05_trait { def main(args: Array[String]): Unit = { val person = new Person("AA"); person.hello() person.happy() person.ku() person.Ha 阅读全文
posted @ 2021-01-31 23:42 陕西小楞娃 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 数组 // var 约等于final 不可变描述的是val指定的引用的值(值: 字面值,地址) val array01 = Array[Int](1,2,3,4) //错误 array01 = Array[Int](1,2,3,4) array01(1) = 99 println(array01(1 阅读全文
posted @ 2021-01-31 12:51 陕西小楞娃 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 流程控制 if var a = 3; if(a > 0){ println(s"$a > 0") }else{ println(s"$a < 0") } 3 > 0 whilr var b = 3; while (b < 10){ println(b) b += 1; } 3 4 5 6 7 8 9 阅读全文
posted @ 2021-01-31 12:40 陕西小楞娃 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1.plugin中安装scala插件 2.项目设置 project structure Global Libraies --> + --> Download 2.11.xx版本 右键、Copy to Project Libraies Libraies目录中会出现 3.创建基本项目 scala -> 阅读全文
posted @ 2021-01-31 12:18 陕西小楞娃 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 为什么用zk做分布式协调服务 1.leader肯定会挂 2.服务不可用 3.zk可以快速选主,并且瞬间能提高到挂掉之前的状态 zk目录结构 1.zookeeper是一个目录树结构 2.node可以存储数据,最大1MB 3.分为临时节点、持久节点、序列临时节点、序列持久节点、client连接先连接se 阅读全文
posted @ 2021-01-31 12:10 陕西小楞娃 阅读(80) 评论(0) 推荐(0) 编辑