嗨,伙计们,我在重复构造函数方面遇到错误,但根据我的作业,我需要另一个构造函数但不同的字段。
规格:
- 会议 – 地点、主题、作为字符串数组的与会者列表、注释、addAttendee(String name) 方法。
- 将单个参加者设置为参加者数组的构造函数。
- 接受分配给与会者列表的字符串数组的构造函数。
- 另外两个构造函数与前两个相同,但允许将注释字段设置为字符串。
这是部分代码
public Meeting(String name) {
this.name = name;
listofAttendees[count] = name;
count++;
// blank constructor for no parameter super constructor
}
// Constructor to accept an array of strings assign to the list of Attendees
public Meeting(String[] listofAttendees) {
this.listofAttendees = listofAttendees;
}
// CONStructors for note field
public Meeting(String notes) { // Error here!
this.notes = notes;
}