标签:[] out 代码 nbsp class ber .com blog bsp
代码:
public class Test
{
static int number;
public Test()
{
number++;
}
public static int getNumb(int number)
{
return number; //返回得到numb的最终的值
}
public static void main(String args[])
{
Test t1=new Test();
Test t2=new Test();
System.out.println("目前创建了"+Test.getNumb(number)+"个对象");
}
}
运行结果:
标签:[] out 代码 nbsp class ber .com blog bsp
原文地址:http://www.cnblogs.com/2016excellent-3584/p/7700744.html