/** Class to represent a Check. @author Bert G. Wachsmuth @version Feb. 2002 */ public class Check extends Transaction { /** This constructor constructs a new check and increments the static variable numChecks. */ public Check(String name, double amount, String date) { super(name, amount, date, "Check"); numChecks++; } /** The amount of a check is stored as a positive number, but returned as a negative value to indicate that check amount must be subtracted from a balance. */ public double getAmount() { return -super.getAmount(); } /** Destructor is called when an object is recycled by Java's automatic garbage collection process. */ public void finalize() { numChecks--; } }