Open In App

Hello World in Scala

The Hello World! the program is the most basic and first program when you dive into a new programming language. This simply prints the Hello World! on the output screen. In Scala, a basic program consists of the following:



Example:




// Scala program to print Hello World! 
object Geeks 
{
    // Main Method 
    def main(args: Array[String]) 
    {
        // prints Hello World
        println("Hello World!"
    }
}

Output:

Hello World!

Explanation:



How to run a Scala Program?

Article Tags :