0

I think it's a dummy question ...

Is there any difference or advantage between these?

object SomeApp extends App {
   println("Hello world!")
}
object SomeApp {
   def main(args: List[String]): Unit = {
      println("Hello world!")
   }
}

M.G.
  • 369
  • 1
  • 14
  • 1
    The first one is roughly equivalent to the second one with some caveats. In general, while I appreciate the effort from the **Scala** maintainers to create something like `App` to ease the getting started experience, reality has shown that it is more trouble than worth it. Just do the second one always; in any case, `App` will despair in **Scala 3**. – Luis Miguel Mejía Suárez Jun 23 '21 at 22:59
  • Thank you Luis for clarifying! – M.G. Jun 23 '21 at 23:44

0 Answers0