Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们可以在没有main方法的java7中创建程序吗?在java 6中我们可以在没有main的情况下创建程序
class WithoutMain { static { System.out.println("Hello, World!"); System.exit(0); } }
但是这个上层程序不能在jdk7中运行,在jdk6中可以正常运行。jdk7有什么办法吗?