public class HowManyClass
{
public static void main(String[] args)
{
HowManyClass e_g1=new HowManyClass();
HowManyClass e_g2=new HowManyClass();
HowManyClass e_g3=new HowManyClass();
System.out.println("一共创建"+n+"个对象");
}
static int n=0;
public HowManyClass()
{
n++;
}
}