object HelloWorld
{
def main(args : Array[String])
{
println("Hello, Hari Taraka Prabhu")
}
}
println("Hello, Hari Taraka Prabhu")
}
}
OR
object HelloWorld {
def main(args: Array[String]) =
println("Hello, Hari Tarkaa Prabhu!")
}
Save with: HelloWorld.scala
Output:
C:\Users\mhtpr\Desktop\SQL.....ETL..Tableau\Materails\scala>scalac HelloWorld.scala
C:\Users\mhtpr\Desktop\SQL.....ETL..Tableau\Materails\scala>scala HelloWorld
Hello, Hari Tarkaa Prabhu!
==================================================================
From Direct Scala Interpreter:
scala> object HelloWorld {
|
| def main(args: Array[String]) =
|
| println("Hello, Hari Tarkaa Prabhu!")
|
| }
// defined object HelloWorld
scala> HelloWorld.main(Array(" "))
Hello, Hari Tarkaa Prabhu!
======================================================================
With Calling Function
scala> def calling =
| {
| println("Hello Hari Taraka Prabhu")
| }
scala> calling
Hello Hari Taraka Prabhu