lundi 11 avril 2016

the constructor **** (*****************) is undefined

it says the constructor Address(String, int, String, String, String) is not defined.

code from my tester class where the error is

// **** error here***    
Address addr1 = new Address("Wheeler's Road", 10, "Belfast", "BT12 5EG", "NI");
// **** error here***    
Address addr2 = new Address("Ivy Hill", 67, "Belfast", "BT17 7BN", "NI");

Student stu1 = new Student("James Black", "07/09/1995", addr1, StudentMode.Fulltime, false);
Student stu2 = new Student("Adam Smith", "12/11/1979", addr2, StudentMode.Parttime, true);

constructor from other class named Address

public Address(String street, int number, String city, String postCode, String county) {
        this.street = street;
        this.number = number;
        this.city = city;
        this.postCode = postCode;
        this.county = county;
}

Aucun commentaire:

Enregistrer un commentaire