java程序设计 应急,各位大侠帮帮忙!
1个回答
2009-06-13
展开全部
class Person {
public Person(String name) {
this(name, Gender.MALE);
}
public Person(String name, Gender gender) {
this.name = name;
this.gender = gender;
}
private String name;
private Gender gender;
}
enum Gender {
MALE, FEMALE,
}
public Person(String name) {
this(name, Gender.MALE);
}
public Person(String name, Gender gender) {
this.name = name;
this.gender = gender;
}
private String name;
private Gender gender;
}
enum Gender {
MALE, FEMALE,
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询