I am getting an error when I compile my code due to an issue with my constructors.
Here is my parent class constructor:
public BankAccount(final String theNameOfOwner, final double theInterestRate)
{
myName = theNameOfOwner;
myInterestRate = theInterestRate;
myBalance = 0;
myMonthlyWithdrawCount = 0;
myMonthlyServiceCharges = 0;
}
Here is my child class constructor:
public SavingsAccount(final String theNameOfOwner, final double theInterestRate)
{
BankAccount(theNameOfOwner, theInterestRate);
myStatusIsActive = false;
myWithdrawalCounter = 0;
}
I am getting the following error:
SavingsAccount.java:7: error: constructor BankAccount in class BankAccount cannot be applied to given types;
{
^
required: String,double
found: no arguments
reason: actual and formal argument lists differ in length
The error says that I require String,double parameters in my BankAccount call in my child constructor if i'm understanding this correctly. The only problem is it looks like I have those parameters correct. Any help/input would be greatly appreciated since I just started programming Java! Thank you!