Assume the existence of a BankAccount class with a constructor that accepts two parameters: a string for the account holder's name, followed by an integer for the account number. Assume a subclass SavingsAccount has been defined with a double instance variable named interestRate. Write a constructor for SavingsAccount that accepts three parameters (in the following order): a string and an integer that are passed to the constructor of BankAccount, and a double that is used to initialize the instance variable.

Respuesta :

Limosa

Answer:

Following code are :

public SavingsAccount(String name, int socSecNumb, double interestRates) {

super(name, socSecNumb);

this.interestRates = interestRates;

}

Explanation:

Here, in the following code we create the class "SavingAccount" and pass three arguments in the parameter list are string data type variable "name", integer data type variable "socSecNumb" and double data type variable "interestRates".

Then, write the definition of the constructor and pass two variables "name" and "socSecNumb".

Then, use "this" pointer to point the variable "interestRates".