嘿嘿,公司最近需要测试SPARK性能,赶上了。。
那LUA之后,SCALA也简单看看,,,
其实,我三月时买了本129元的SPARK的书,,全国只那一本哈。
package com.hengheng.scala class HelloScala { } object HelloScala { def hello(name: String) : String = { "Hello " + name } def helloscala() { println("Hello Scala, this is rocky!") } def add = (x : Int, y : Int) => x + y val sum = (x : Int, y : Int) => x + y def sum2(x : Int)(y : Int) = x + y def variableParameter(s : String*) = { s.foreach(x => println(x)) } def helloDefault(name : String = "www.sparkinchina.com") : String = { "Hello " + name } def main(args: Array[String]) { println("Hello Scala!!!") println(hello("Scala")) helloscala println(add(1, 2)) println(sum(1, 2)) println(sum2(3)(2)) variableParameter("I", "LOVE", "Spark") println(helloDefault()) } }
时间: 2024-10-06 06:38:37