I want to create an array of class Person in class Donator, but I got this error "error: constructor Person in class Person cannot be applied to given types;"
Did I miss any important code?
Here is my code.
Person.java
public class Person { private String Name, Address, Gender, BloodType; private int ICNumber; private double Height, Weight; //constructor public Person(String n, String add, String gen, String bt, int ic, double h, double w) { Name = n; Address = add; Gender = gen; BloodType = bt; ICNumber = ic; Height = h; Weight = w; } //abstract method //abstract void printPerson(); } //close Person Donator.java
public class Donator extends Person { private String donatorID; private Person[] myDonator; private int numberOfDonator; //constructor public Donator(String id, String d) { donatorID = id; myDonator = new Person[2]; } public String getDonatorID() { return donatorID; } }//close Donator
Personobject but you are not supplying the required parameters to the constructor.