标签:return get 查询 一个 对象 ber private static scanner
import java.util.Scanner;
public class Number {
private static int i = 0;
public Number()
{
i++;
}
public static int getNumber()
{
return i;
}
public static void main(String[] args) {
Number t1 = new Number();
Number t2 = new Number();
Number t3 = new Number();
Number t4 = new Number();
System.out.println("一共创建了" + Number.getNumber() + "个对象");
}
}
标签:return get 查询 一个 对象 ber private static scanner
原文地址:https://www.cnblogs.com/fuheishi/p/9825992.html