JAVA
9. BankAccount and SavingsAccount Classes Design an abstractclass named BankAccount to hold the following data for a bankaccount:
• Balance
• Number of deposits this month
• Number of withdrawals
• Annual interest rate
The class should have the following methods:
Constructor:
The constructor should accept arguments for the balance andannual interest rate.
deposit:
A method that accepts an argument for the amount of the deposit.The method should add the argument to the account balance. Itshould also increment the variable holding the number ofdeposits.
withdraw:
A method that accepts an argument for the amount of thewithdrawal. The method should subtract the argument from thebalance. It should also increment the variable holding
OR
OR