public class Demo{ public Demo(){ System.out.println("Hello World!"); } public static void main(String[]args){ new Demo(); #调用Demo里面的打印结果 } }
输出结果为Hello World!
尝试着写博客,如果文章有什么不好的地方,请指点一下,谢谢