无限次的调用了主方法main()
当命令行参数为空时即args=null时 不执行new RandomTest(){{RandomTest.main(null);}}.equals(null)
输出为hello,
当命令行参数不为空时执行
new RandomTest(){{RandomTest.main(null);}}.equals(null),
代码中RandomTest.main(null)的值为word,
new RandomTest(){{RandomTest.main(null);}}.equals(null)等价于 new RandomTest(){ System.out.print("world");}.equals(null),
而new RandomTest(){ System.out.print("world");}为null
|