如果我有一堂课:
public class HelloWorld {
public static String main(String[] args) throws IOException {
public createMessage(){
String message = "Hello World!";
}
}
return message; //return of the main static method
}
为什么我不能HelloWorld.main(args)
从另一个班级调用 main ?
String msg = (String) HelloWorld.main(args);
System.out.println(msg);
按照我们调用静态方法的方式。