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 nstance 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.

LANGUAGE: JAVA

CHALLENGE:

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 nstance 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.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

Leave a Comment

You must be logged in to post a comment.