package com.sf.day07;

import java.util.Scanner;

public class UserManager {

    public static void main(String[] args) {
        User user = new User();
        user.setUserName("admin");
        user.setPassWord("123456");
        boolean login = login(user.getUserName(), user.getPassWord());
        if(login){
            System.out.println("登录成功");
        }else {
            System.out.println("登录失败");
        }
    }

    public static boolean login(String userName, String passWord){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username = scanner.next();
        System.out.println("请输入密码：");
        String password = scanner.next();
        if(username.equals(userName)  && password.equals(passWord)){
            return true;
        }
        return false;
    }

}
