Lorenzo Gallegos, Keith Risper, Lars Walen
object HelloWorld extends App {
println("Hello, World!")
}
or
println("Hello, World!")
(99 to 1 by -1).par foreach {n =>
println("""|%d bottles of beer on the wall
|%d bottles of beer
|Take one down, pass it around
|%d bottles of beer on the wall\n""".stripMargin format (n, n, n -1))}
class Point(xc: Int, yc: Int) {
var x: Int = xc
var y: Int = yc
def move(dx: Int, dy: Int) {
x = x + dx
y = y + dy
}
override def toString(): String = "(" + x + ", " + y + ")";
}
James Strachan, creator of Groovy, thinks so.
Just about everything we learned about in Haskell
val s = for (x <- 1 to 25 if x*x > 50) yield 2*x
list map { x => sqrt(x) }
list.filter(_ > 2).map(_ * 3).sum