Sign in using Google or Yahoo! id.  

public static void main(String[]) class in Scala

 Comments Share:   Twitter   Reddit   HackerNews   Facebook 

Notes from: http://www.codecommit.com/blog/scala/scala-for-java-refugees-part-1

Extending Application

object HelloWorld extends Application {
  println("Hello, World!")
}

$ scalac HelloWorld.java $ scala HelloWorld

Using psvm

object HelloWorld2 {
  def main(args:Array[String]) = {
    args.foreach(arg => {
      // do something!
    })
  }
}

Advantage of this approach: Command line parsing supported.

Posted on September 08, 2010 05:16 PM by Subhash Chandran
scala
blog comments powered by Disqus