标题:大家帮忙看看从键盘输入那该怎么改
取消只看楼主
lowryfly
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2012-11-28
结帖率:75%
 问题点数:0 回复次数:0 
大家帮忙看看从键盘输入那该怎么改
package lang.lang1;
import *;

import

class person{
    private int No;
    String Name,password;
    private float yue;
    void initperson(String newName,String newpassword,int newNo,float newyue){
        Name = newName;
        password = newpassword;
        yue = newyue;
        No = newNo;
    }
    void printperson(){
        System.out.println("户名:"+Name);
        System.out.println("账号:"+No);
        System.out.println("余额:"+yue);
    }
    void examinperson() throws IOException {
        System.out.println("请输入密码");
        BufferedReader str = new BufferedReader(new InputStreamReader(System.in));
        String a = str.readLine();
         System.out.println(a);
        if(a==password){
            printperson();
        }
        else{
            System.out.println("密码错误");
        }
    }
}
public class Bank {

    public static void main(String[] args) throws IOException {
        person wo = new person();
        wo.initperson("张三", "abc", 123456, 5000);
        wo.examinperson();

    }

}
就是简单的输入密码显示信息,输入部分搞不明白
搜索更多相关主题的帖子: package import password person private 
2013-06-06 19:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-414682-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.046765 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved