object HelloWorld extends App {
println("Hello, world!")
}
Live demo
By extending the App trait, you can avoid defining an explicit main method. The entire body of the HelloWorld object is treated as "the main method".
2.11.0
Delayed Initialization
Per the official d...