Hi,
Scala provides a helper class, called App, that provides the main method. Instead of writing your own main method, classes can extend the App class to produce concise and executable applications in Scala.
Here is an example is shown:
object Main extends App {
Console.println("Hello Scala: " + (args aString ", "))
}
Here, object Main inherits the main method of App trait and args returns the current command-line arguments as an array, similar to String[] args in Java main method.
Hope this helps!!
If you need to learn more about Scala, It's recommended to join Scala Certification course today.
Thank you!