Download Getting Started with Scala 26-Jul-16

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Transcript
Hello World






/** Everybody's first program */
object HelloWorld {
def main(args: Array[String]) {
println("Hello, World!")
}
}
Save on a file named HelloWorld.scala
Compile with scalac HelloWorld.scala (or from your IDE)
Run with scala HelloWorld (or from your IDE)
Generate documentation with scaladoc HelloWorld.scala
The above code creates a singleton object



Everything in the object is like Java’s static
Scala doesn’t have static
Scala does have classes; we’ll get to those later
3