package _05_set和构造方法区别;

public class Account {
    private String accountId;
    private String password;


    public Account() {
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    // 有参数构造在new Account 会触发
    public Account(String accountId, String password) {
        this.accountId = accountId;
        this.password = password;
    }

//    public void setAccountId(String accountId) {
//        this.accountId = accountId;
//    }

    /**
     * 获取
     * @return accountId
     */



    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public String toString() {
        return "Account{accountId = " + accountId + ", password = " + password + "}";
    }
}
