Why does the Grade class which extends the School class give me an error when a new object is being created and the constructor is being called and passed the correct amount of parameters with the correct datatypes to the constructor?
I get the following warning in Netbeans using Java Se 6
cannot find symbol: Constuctor School();
package school;
public class School {
String name;
String location;
int pupils;
School(String name, String location, int pupils) {
this.name = name;
this.location = location;
this.pupils = pupils;
}
}
package school;
public class Grade extends School {
School school = new School("Your Schools Name", "Your schools Location", 1700);
}
Constructors are not inherited. Your subclass needs its own constructor:
Besides, this is very questionable design. A grade is not a school.