import java.util.Date; /** * This class is a storage class to store a 'check'. It extends Transaction * and therefore inherits all methods and fields from that class. */ public class Check extends Transaction { /** * Constructor used to make a new deposit. */ public Check(String date, double amount, String name) { super(date, amount, name, "Check"); // using superclass constructor } /** * Overrides the inherited 'getAmount' method to return the amount as * a negative number. */ public double getAmount() { return -super.getAmount(); } }