I'm writing a group of subclasses associated with abstract super class. There is one default constructor but when I am making another constructor it's giving me the following error:
Implicit super constructor Event() is undefined. Must explicitly invoke another constructor
My code is below:
public class Meeting extends Event {
private String location;
private String subject;
private String notes;
private String attendeeName;
// Array of attendees as string
private String[] listofAttendees = new String[10];
public Meeting(Date dueDate, Date reminderDate, String location,
String subject, String notes) {
super(dueDate, reminderDate);
this.location = location;
this.subject = subject;
this.notes = notes;
}
public Meeting(String attendeeName) { // this is the error constructor
this.attendeeName = attendeeName;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String[] addAttendee(String name) {
// adding for loop for adding the list of attendees to the array
for (int i = 0; i < listofAttendees.length; i++) {
// array index(i) = name of attendee
listofAttendees[i] = name;
}
return listofAttendees;
}
}