标签:string stat 生成 img new 创建对象 对象 es2017 static
public class Lei {
	static int x=0;
	//生成一个对象就自加加
	public Lei()
	{
	x++;
	}public static void main(String[] args)
	{
	    Lei L1=new Lei();
	    Lei L2=new Lei();
	    Lei L3=new Lei();
	    Lei L4=new Lei();
	    Lei L5=new Lei();
	    Lei L6=new Lei();
	    Lei L7=new Lei();
	System.out.println("创建对象数量"+x);
	}
}

标签:string stat 生成 img new 创建对象 对象 es2017 static
原文地址:http://www.cnblogs.com/lxy10375/p/7700749.html