【发布时间】:2014-08-28 12:55:34
【问题描述】:
我知道有很多这样的问题,但在所有问题中,答案都是“你不能在非公共类中使用 main 方法运行 Java 程序”。 (What if main method is inside "non public class" of java file?)
但是,我在 NetBeans 中尝试了这种情况,并且运行得非常好。为什么?
main 是否在公共类a 约定或严格规则中?
【问题讨论】:
-
this 不回答你的问题吗?