home *** CD-ROM | disk | FTP | other *** search
/ Learn Java Now / Learn_Java_Now_Microsoft_1996.iso / JavaNow / Code / Chap07 / BankAccount / CheckingAccount.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-07-29  |  719 b   |  21 lines

  1. class CheckingAccount extends BankAccount {
  2.    private static int m_nNextAccountNo = 800001;
  3.    private int nAccountNo;
  4.  
  5.    public void Interest() {
  6.       if (((BankAccount)this).Balance() > (double)500.0F) {
  7.          super.Interest();
  8.       }
  9.  
  10.    }
  11.  
  12.    CheckingAccount(double dInitialBalance) {
  13.       super(dInitialBalance);
  14.       this.nAccountNo = m_nNextAccountNo++;
  15.    }
  16.  
  17.    public int AccountNo() {
  18.       return this.nAccountNo;
  19.    }
  20. }
  21.