Scala
文章平均质量分 94
Scala
顧棟
coding and writing and 承接需求
展开
-
【Scala学习】测试类
文章目录SBT AND SCALATESTTHE MOST USED SCALA BUILD TOOL (SBT)The sbt directory structureCreating a “Hello, world” sbt project directory structureCreating a first *build.sbt* fileA “Hello, world” programUSING SCALATEST WITH SBTCreating the project directory str翻译 2021-08-17 15:15:29 · 779 阅读 · 0 评论 -
【Scala学习】函数式编程续 case类
文章目录CASE CLASSESWith `apply` you don’t need `new`No mutator methodsAn `unapply` method`copy` method`equals` and `hashCode` methods`toString` methodsThe biggest advantageCASE OBJECTSCase objectsCreating enumerations with case objectsUsing case objects as me翻译 2021-08-17 15:14:18 · 239 阅读 · 0 评论 -
【Scala学习】之函数式风格编程
FUNCTIONAL PROGRAMMINGhttps://docs.scala-lang.org/overviews/scala-book/functional-programming.htmlScala 允许您以面向对象编程 (OOP) 风格、函数式编程 (FP) 风格甚至混合风格编写代码,结合使用这两种方法。本书假设您是从 Java、C++ 或 C# 等 OOP 语言来到 Scala 的,因此除了涵盖 Scala 类之外,本书中没有任何关于 OOP 的特殊部分。但是由于 FP 风格对于许多开发翻译 2021-08-17 15:12:29 · 303 阅读 · 0 评论 -
【Scala学习】之Tuples和OOP 示例
文章目录A FEW MISCELLANEOUS ITEMSTUPLESA few more tuple detailsReturning a tuple from a methodTuples aren’t collectionsAN OOP EXAMPLEA few classesAdding behavior to PizzaAdding behavior to OrderTesting those classesExperiment with the code yourselfA FEW MISCE翻译 2021-08-06 17:49:19 · 195 阅读 · 0 评论 -
【Scala学习】之SCALA 集合类
文章目录SCALA COLLECTIONSThe main Scala collections classesTHE ARRAYBUFFER CLASSMore ways to work with `ArrayBuffer`THE LIST CLASSCreating ListsAdding elements to a ListHow to remember the method namesHow to loop over listsA little bit of historyTHE VECTOR CLA翻译 2021-08-06 17:42:38 · 269 阅读 · 0 评论 -
【Scala学习】之TRAITS和抽象类
文章目录SCALA TRAITS AND ABSTRACT CLASSESUsing Scala Traits as InterfacesA simple exampleExtending a traitExtending multiple traitsUSING SCALA TRAITS LIKE ABSTRACT CLASSESA first exampleOverriding an implemented methodMixing in multiple traits that have behavi翻译 2021-08-06 17:41:10 · 272 阅读 · 0 评论 -
【Scala学习】之Scala中的类
文章目录SCALA CLASSESBasic class constructor`val` makes fields read-onlyClass constructorsOther Scala class examplesAUXILIARY CLASS CONSTRUCTORSNotesSUPPLYING DEFAULT VALUES FOR CONSTRUCTOR PARAMETERSBenefitsBonus: Named parametersA FIRST LOOK AT SCALA METHODS翻译 2021-08-06 17:39:00 · 282 阅读 · 0 评论 -
【Scala学习】之Scala快速入门
Scala 简单介绍快速入门翻译 2021-08-01 21:37:19 · 322 阅读 · 0 评论