I am writing a program in Java and I am facing this problem.
I have made an abstract superclass Customer
and a subclass RegisteredCustomer
and of course the main class. I cannot find a way of using the constructor of the RegisteredCustomer
in the main.
The message The method RegisteredCustomer(String, long, String, String) is undefined for the type RegisteredCustomer
even though I have made the exact constructor with these parameters in the RegisteredCustomer
.
I have tried RegisteredCustomer.RegisteredCustomer(fn , tel , adr , em);
and Customer.RegisteredCustomer.RegisteredCustomer(fn , tel , adr , em);
REGISTEREDCUSTOMER
public class RegisteredCustomer extends Customer {
private static int count = 0;
private int id;
private String email;
private String password;
public RegisteredCustomer(String fullName, long telephone, String adress, String email) {
super(fullName, telephone, adress);
this.id = ++ count;
this.email = email;
Customer.getCustomers().add(Customer.getCustomers().size() , this);
}
MAIN
RegisteredCustomer.RegisteredCustomer(fn , tel , adr , em);