What really happens behind the Scala runtime/REPL when running a '.scala' program?
问题 When I run something like the following from the command line, what really happens? > scala hello.scala Is there a hello.class generated, executed, and then discarded? Or does Scala behave somehow like an interpreter in this case? I am just thinking that, of course, I cannot do the same for Java: > java hello.java 回答1: Yes, there is a hello.class generated. The compiler will wrap your code inside a Main object, compile it then execute Main.main , given hello.scala of println(args.mkString)