Given the Savings sub-class that follows, create the super-class named ‘Account’
ID: 3916812 • Letter: G
Question
Given the Savings sub-class that follows, create the super-class named ‘Account’: ? Make the Account class abstract. ? Data variables in the Account class are ‘name’ (type String which can be accessed directly by the sub-class but not by the outside world,) and ‘balance’ (type double which cannot be accessed by any sub-class.) ? Add the methods that are referenced in the Savings sub-class. ? Make it so that the ‘deductFees’ method is known to the Account class, but the implementation for deductFees is required to be in the Savings class.
Explanation / Answer
public abstract class Account {
protected String name;
private double balance;
public abstract void deductFees();
}
class Savings extends Account{
@Override
public void deductFees() {
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.