Java 没有 main 方法也可以打印 Hello world

1 public class TestNoMain{
2     static{
3         System.out.println("Hello world!");
4         System.exit(0);//
5     }
6 }

 

posted @ 2012-12-28 17:17  bruceHuang  阅读(317)  评论(0编辑  收藏  举报