一个类是:
public class Address{
String address;
String zipCode
}
另一个类是:
public class Worker{
String name;
int age;
Address addr;
}
这个Worker的有参构造怎么写
一个类是:
public class Address{
String address;
String zipCode
}
另一个类是:
public class Worker{
String name;
int age;
Address addr;
}
这个Worker的有参构造怎么写
public class Address{
String address;
String zipCode
}
class Worker{
String name;
int age;
Address addr;
public Worker(){}
public Worker(String name,int age,Address addr){
this.name = name;
this.age = age;
this.addr = addr;
}
}