1-11编程问题
public class Test{ static class User{ private String name; private String password; public User(String name, String password){ this.name = name; this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public void methods(){ System.out.println("用户名"+this.getName()); System.out.println("密码"+this.getPassword()); } } static class ManagementUser{ public String CheakUser(User one,User two){ if(one.getName().equals(two.getName())&one.getPassword().equals(two.getPassword())) { System.out.println("======================="); }else{ System.out.println("======================="); System.out.println("两次输入代码不一致"); } return null; } } // 测试方法 public static void main(String[] args) { //实例化对象,调用相关方法实现运行效果 User one = new User("luck","123456"); User two = new User("Mike","123456"); one.methods(); two.methods(); ManagementUser three = new ManagementUser(); three.CheakUser(one,two); } } 具体是哪里错了求老师指点
12
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星