Thursday, August 27, 2009

Beginning Scala - Part 6: Hello World

and now ... the customary "Hello World" version of Scala:
scala> println("Hello World!!!")
Hello World!!!
Notice, Scala code need not be terminated by a semi-colon (;). You can type this in the interactive session or save in it HelloWorld.scala. The scripts are executed with the commad scala whereas classes are compiled with scalac. The latter creates JVM class files. The file extension for scala programs is .scala.

The println is part of scala's Predef, predefined stuff automatically part of every program, just like java.lang in Java.

No comments:

Post a Comment