这是一个骨架单例
object MrJob {
def main(args: Array[String]) {
}
}
编译(scalac)javap后显示:
$javap -classpath target/classes com.blazedb.scalademo.MrJob$
Compiled from "SDemo.scala"
public final class com.blazedb.scalademo.MrJob$ extends java.lang.Object{
public static final com.blazedb.scalademo.MrJob$ MODULE$;
public static {};
public void main(java.lang.String[]);
}
那么如何使 main 方法静态化呢?谢谢
更新(下面有 Robin Green 的回答):我想在本文中添加下面的答案以便于查看:
$javap -classpath target/classes com.blazedb.scalademo.MrJob
Compiled from "SDemo.scala"
public final class com.blazedb.scalademo.MrJob extends java.lang.Object{
public static void main(java.lang.String[]);
}