Write a subclass called savingsaccount that extends account and adds an interest rate variable. write a constructor with 3 arguments (name, balance, interest rate) for the savingsaccount class that uses the super constructor. write a tostring() method for savingsaccount that returns a call to the super tostring() method and the interest rate. write an equals method for savingsaccount that calls the superclass equals method and checks that the interest rates are equal
Answer
0 (0 оценки)
0
YulTheNinja 4 months ago
Светило науки - 368 ответа - 0 помощи

public class Account

{

   private String name;

   private double balance;

   public Account(String name, double balance)

   {

      this.name = name;

      this.balance = balance;

   }

   public String toString() {

    return name + ", " + balance;

   }

Still have questions?