怎么做??
1 回答
已采纳
田心枫
TA贡献1064条经验 获得超383个赞
package com.imooc.ten; /** * Created by junfeng on 17/4/10. */ public class User { private String username; private int password; public User(String username, int password) { this.username = username; this.password = password; System.out.println("用户名:"+username); System.out.println("密码:"+password); } public int getPassword() { return password; } public void setPassword(int password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } }这样啊。private 关键字 然后get set
添加回答
举报
0/150
提交
取消