随笔分类 -  scala

摘要:原文链接Scala Option[T] is a container for zero or one element of a given type. An Option[T] can be eitherSome[T]orNoneobject, which represents a missing ... 阅读全文
posted @ 2015-08-05 17:19 masic 阅读(3510) 评论(0) 推荐(2)
摘要:原帖:http://stackoverflow.com/questions/1722137/scala-2-8-collections-design-tutorial There's a2.8 collection walk-throughby Martin Odersky which should... 阅读全文
posted @ 2015-07-19 10:52 masic 阅读(1127) 评论(0) 推荐(0)
摘要:原文链接Scala 作为一门函数式编程语言,对习惯了指令式编程语言的同学来说,会不大习惯,这里除了思维方式之外,还有语法层面的,比如underscore(下划线)就会出现在多种场合,令初学者相当疑惑,今天就来总结下 Scala 中下划线的用法。?123456789101112131415161718... 阅读全文
posted @ 2015-07-15 22:44 masic 阅读(310) 评论(0) 推荐(0)
摘要:原文链接ProblemYou want to control the visibility of fields that are used as constructor parameters in a Scala class.SolutionAs shown in the following exa... 阅读全文
posted @ 2015-07-14 11:12 masic 阅读(182) 评论(0) 推荐(0)
摘要:程序开始可以在某一个object中定义main方法object MyObject{def main(args:Array[String]{Println("Hello world")}}也可以通过对象扩展APP类,将代码放在构造器的方法中 (TheApptrait can be used to qu... 阅读全文
posted @ 2015-07-13 22:33 masic 阅读(179) 评论(0) 推荐(0)