package _05_set和构造方法区别;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入初始化账号");
        String account = scanner.next();
        System.out.println("请输入初始密码");
        String password = scanner.next();

        // 调用有参构造器完成属性初始化
        // 把账号和密码通过构造方法完成设置  new Account(zhangsan,123)
        Account account1 = new Account(account,password);
//        getAccountId() : zhangsan
        System.out.println("最初账号:"+ account1.getAccountId());
        System.out.println("最初密码:"+ account1.getPassword());

        System.out.println("=======================////////////=");
        // 请输入要修改Miami
        System.out.println("请输入要修改密码");
        String updatePassword = scanner.next();
        account1.setPassword(updatePassword);
        System.out.println("账号:"+ account1.getAccountId());
        System.out.println("更新密码:"+ account1.getPassword());
    }
}
