Skip to main content

scala Hello World

The code below prints Hello World!

Hello.scala file (a name of file doesn't matter)
object HelloWorld {
  def main(args: Array[String]) {
    println("Hello World!")
  }
}
Key word object is used to create a singleton object.

To run this script use scala interpretor (check scala command line tools).

Comments