I'm just starting out BlueJ and I can't figure out how to call a method that takes input from another method from a different class and adds the inputs to an array. By the way, this project is the "club" project from BlueJ.
Here is the error: http://ift.tt/1EcIkpg
The code with the error (the ".add" is highlighted to be the error):
(insert class, constructor, etc here)
public void join(Membership member)
{
members.add(member);
}
The method that I'm trying to call for the user inputs:
public Membership(String name, int month, int year)
throws IllegalArgumentException
{
if(month < 1 || month > 12)
{
throw new IllegalArgumentException(
"Month " + month + " out of range. Must be in the range 1 ... 12");
}
this.name = name;
this.month = month;
this.year = year;
}
Aucun commentaire:
Enregistrer un commentaire