zoukankan      html  css  js  c++  java
  • 银行卡系统

    package oo.day06;
    //银行卡系统
    public class UnionPayTest {
    public static void main(String[] args) {
    ICBCImpl icbc1 = new ICBCImpl();
    ICBC icbc2 = new ICBCImpl(); //向上造型
    UnionPay icbc3 = new ICBCImpl(); //向上造型
    }
    }

    interface UnionPay{ //银联接口
    public double getBalance(); //查询余额
    public boolean drawMoney(double number); //取钱
    public boolean checkPwd(String input); //检查密码
    }
    interface ICBC extends UnionPay{ //工行接口
    public void payOnline(double number); //在线支付
    }
    interface ABC extends UnionPay{ //农行接口
    public boolean payTelBill(String phoneNum,double sum); //支付电话费
    }
    class ICBCImpl implements ICBC{ //工行卡
    public double getBalance(){return 0.0;}
    public boolean drawMoney(double number){return false;}
    public boolean checkPwd(String input){return false;}
    public void payOnline(double number){}
    }
    class ABCImpl implements ABC{ //农行卡
    public double getBalance(){return 0.0;}
    public boolean drawMoney(double number){return false;}
    public boolean checkPwd(String input){return false;}
    public boolean payTelBill(String phoneNum,double sum){return false;}
    }

  • 相关阅读:
    Arduino学习笔记10
    Arduino学习笔记07
    Arduino学习笔记6
    Arduino学习笔记5
    Arduino学习笔记4
    Arduino学习笔记3
    linux下库文件的编程
    学习编程语言究竟学什么
    Arduino学习笔记2---数字温度计
    Arduino学习笔记0---开发板的了解
  • 原文地址:https://www.cnblogs.com/xiaziteng/p/4731410.html
Copyright © 2011-2022 走看看