I keep getting an error saying that "call to super must be the first statement in the constructor".
The problem is that it is the first statement in my constructor.
public void CheckingAccountCustomer(int a){
super(n, p, b);
accountNo = a;
}
And here is my superclass for this as well.
public void customer(String n, int p, double b){
name = n;
pin = p;
balance = b;
}
What am I doing wrong here?
This code
public void customer(String n, int p, double b){
is not a constructor. Constructors don't have return types, e.g. void
. Assuming your class name is customer
:
public customer(String n, int p, double b){
This applies to CheckingAccountCustomer
too.