首页 > 其他 > 详细

不用main方法,也可以打印helloworld

时间:2015-04-29 11:49:01      阅读:207      评论:0      收藏:0      [点我收藏+]
package com.ray.object;

/**
 * 不用main方法,也可以打印Hello World!
 * 
 * @author ray
 * @since 2015-04-29
 * @version 1.0
 * 
 */
public class Person {
	static {
		System.out.println("Hello World!");
		System.exit(0);
	}

	// 由于使用ide,有main方法执行更方便
	public static void main(String[] args) {

	}
}

不用main方法,也可以打印helloworld

原文:http://blog.csdn.net/raylee2007/article/details/45362745

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!