I program on netbeans ubuntu java standart project (test preparation). when I create AccountStudent.java I get error.
Account.java
public abstract class Account {
protected double _sum;
protected String _owner;
protected static int accountCounter=0;
public Account(String owner){
this._sum=0;
this._owner=owner;
accountCounter++;
}
}
AccountStudent.java- error: cannot find symbol: constructor Account()
public class AccountStudent extends Account{
}
Fix for problem- add empty Account constructor:
Account.java
public abstract class Account {
protected double _sum;
protected String _owner;
protected static int accountCounter=0;
public Account(){
}
public Account(String owner){
this._sum=0;
this._owner=owner;
accountCounter++;
}
}
Why should i create empty constructor Account if already he exist because he inherit Object class?
Thanks