package cn.edu.bjut.chapter4; public class CardTester { public static void main(String[] args) { System.out.println("------------ 借记卡账户 ------------"); Card debitCard = new DebitCard("CHK20100117001", 100); System.out.println("取90元的结果:" + debitCard.draw(90)); debitCard.deposit(90); System.out.println("取120元的结果:" + debitCard.draw(120)); System.out.println("------------ 信用卡账户 ------------"); Card crebitCard = new CreditCard("CHK20100117002", 100, 50); System.out.println("取90元的结果:" + crebitCard.draw(90)); crebitCard.deposit(90); System.out.println("取120元的结果:" + crebitCard.draw(120)); crebitCard.deposit(120); System.out.println("取160元的结果:" + crebitCard.draw(160)); } }