根据下面代码,,判断控制台输出的是????
class Guees
{
//定义属性并私有性
private static int nextId;
private int id = assignId();//调有assignId方法来为ID赋值
private static int assignId()
{
int r = nextId;
nextId++;
return r;
}
void show()
{
System.out.println(id);
}
}
class Test
{
public static void main(String[] args)
{
Guees num= new Guees();
Guees num1= new Guees();
Guees num2= new Guees();
new Guees().show();
num.show();
num2.show();
num.show();
num1.show();
}
}1 0 2 0 3
|
|