The code below prints Hello World!
Hello.scala file (a name of file doesn't matter)
To run this script use scala interpretor (check scala command line tools).
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
Post a Comment