在学习CoreJava中,看到一个构造器可以调用同一个类另个一构造器的部分,
class Employee
{
private static int nextId;
private int id;
private String name;
private double salary;
static
{
Random generator=new Random();
nextId=generator.nextInt(1000)+1;
}
{
id=nextId;
nextId++;
}
public Employee(String name,double salary)
{
this.name=name;
this.salary=salary;
}
public Employee(double s)
{
this("Employee#"+nextId,s);
}
public Employee()
{
}
}
this("Employee#"+nextId,s); 这句话没看懂,请问有人能帮忙解释一下吗?