码迷,mamicode.com
首页 > 编程语言 > 详细

java get银行练习题

时间:2016-05-18 17:42:41      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

package mianxiangduixiang;

import java.nio.charset.MalformedInputException;

//银行
public class getyinhang {
    String zhanghu ;
    double cunkuanyue;
    double zhanghuyue;
    public String getZhanghu() {
        return zhanghu;
    }
    public void setZhanghu(String zhanghu) {
        this.zhanghu = zhanghu;
    }
    public double getCunkuanyue() {
        return cunkuanyue;
    }
    public void setCunkuanyue(double cunkuanyue) {
        this.cunkuanyue = cunkuanyue;
    }
    public double getZhanghuyue() {
        return zhanghuyue;
    }
    public void setZhanghuyue(double zhanghuyue) {
        this.zhanghuyue = zhanghuyue;
    }
    //行为
        //显示名字
        private void showzhanghuyue()
        {
            System.out.println("您的账户余额"+this.zhanghuyue);
        }
        //构造方法
        public getyinhang(String zhanghu, double cunkuanyue, double zhanghuyue) 
        {
            super();
            this.zhanghu = zhanghu;
            this.cunkuanyue = cunkuanyue;
            this.zhanghuyue = zhanghuyue;
            
        }
        
        public getyinhang(String zhanghu) {
            super();
            this.zhanghu = zhanghu;
        }
        public static void main(String[] args) {
            getyinhang zhanghu1 =new getyinhang("13646449991");
            zhanghu1.setCunkuanyue(1235);
            zhanghu1.setZhanghuyue(1358);
            
            System.out.println("您的账户是"+zhanghu1.getZhanghu()+"余额还有"+(zhanghu1.getZhanghuyue()+zhanghu1.getCunkuanyue()));
        }
     
//实现了存钱的功能

java get银行练习题

标签:

原文地址:http://www.cnblogs.com/zzyu/p/5505620.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!