ScalaにApplicationというtraitがある。 これを継承すると、mainメソッドを記述する必要がなくなり、そのクラスのbody部分が実行される。 object ApplicationTrait extends Application { Console println("Hello Scala!") } 実行結果。 Hello Scala!これはApplication traitがmainメソッドを定義しているから。 trait Application { /** The time when execution of this program started. */ val executionStart: Long = currentTime /** The default main method. * * @param args the arguments passed t