Hello World Program in Scala - The Coding Shala
Home >> Learn Scala >> Hello World Program
Other Posts You May Like
In this post, we will learn how to write Hello World Program in Scala programming language.
Hello World Program in Scala
The following Scala program will print "hello world".
Scala Program:
// scala program to print hello world object HelloWorld { def main(args: Array[String]){ println("hello world"); } }
The Program has 3 main components:
- Object: Object is the keyword used to create objects. here HelloWorld is an object.
- Function: def keyword is used to define the function in Scala. here main is the function, it also starting point in scala like Java.
- Println: Println is a method in scala that is used to display the output in the console.
- Hello World Program in Java
- Java Object and Classes
- Check if the given String is palindrome or not
- Power of Two
- Single Number
Comments
Post a Comment