Tuesday, November 5, 2013

Hello Scala

I want to head-start with Scala, how can I write hello world program in Scala?

I found multiple ways of getting started with Scala, downloaded the latest scala-eclipse IDE backed by JDK7. Below are the different ways to Hello Scala:

Via Scala object:

Create below Scala object & execute this as Scala application

package learn.scala
object Hello {
  def main(args: Array[String]): Unit = {
    println("world")
  }
}

Via Scala worksheet:

Create Scala worksheet with below statement and saving the file shall do the needful

package learn.scala
object HelloWorkSheet {
    println("Hello World")
}

I plan to sync my worksheet and keep this updated on GIST. Here's the link to my GIST(https://gist.github.com/ajjain/7364919)

No comments:

Post a Comment