java - Duplicate method Meeting(String) in type Meeting - Error -
hi guys i'm having error regarding duplicate constructors, according assignment need constructor different field.
specifications:
- meeting – location, subject, list of attendees string array, notes , addattendee(string name) method.
- constructor set single attendee attendee array.
- constructor accept array of strings assign list of attendees.
- two more constructors same previous 2 allow setting note field string.
here part of code
public meeting(string name) { this.name = name; listofattendees[count] = name; count++; // blank constructor no parameter super constructor } // constructor accept array of strings assign list of attendees public meeting(string[] listofattendees) { this.listofattendees = listofattendees; } // constructors note field public meeting(string notes) { // error here! this.notes = notes; }
you can not have more 1 method same name , same type of parameters.
make 1 constructor name , notes, , if want assign i.e name pass null parameter notes.
public meeting(string names, string notes);
Comments
Post a Comment