In this article, we will write a simple Hello World program in Scala using Eclipse IDE.
Refer following article, if you haven’t setup your Eclipse IDE for Scala development :
Scala IDE setup with Eclipse
Step 1 : Create new Scala project in Eclipse
From File menu, select New -> Scala project and provide the project a name
Step 2 : Create a Scala object
Create a new Scala Object using File -> New -> Scala Object :
Provide a name for your Scala application and click Finish to create the file.
Step 3 : Add code that prints Hello Scala
Add the following code in HelloWorld.scala :
object HelloWorldScala { def main(args: Array[String]) { println("Hello Scala !!") } }
Step 4 : Run the Scala program
Click on Run button or Run menu to run this as a Scala application.
Set the Run configuration if needed.
Output :
Hello Scala !!
Read Next
© 2016 – 2017, https:. All rights reserved. On republishing this post, you must provide link to original post
#