Question
@override public int withdraw(int amountToWithdraw) if (getBalance() - amountToWithdraw < -100_000) return getBalance() int newBalance = super.withdraw(amountTowithdraw) if (newBalance < 0 && newBalance > -100_000
@override
public int withdraw(int amountToWithdraw)
if (getBalance() - amountToWithdraw < -100_000)
return getBalance()
int newBalance = super.withdraw(amountTowithdraw)
if (newBalance < 0 && newBalance > -100_000
newBalance -= 10
return newBalance;
And my superclass method that im trying to override is
public int withdraw(int amountTowithdraw)(
int newBalance = this.balance - amountToWithdraw
if (newBalance >= 0
this.balance = newBalance
return newBalance;
I made sure that they lined up correctly and both were public but I keep getting the same error of checking account must override withdrawint make sure access for the method is public why?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started