码迷,mamicode.com
首页 > 其他好文 > 详细

条件语句模拟验证登录

时间:2017-05-10 20:36:49      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:登录密码   line   imp   ati   port   int   class   user   登录验证   

package course;

import java.util.Scanner;

public class CheckLogin {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入登录用户名:");
        String username=scan.nextLine();
        System.out.println("请输入登录密码:");
        String password=scan.nextLine();
        if(!username.equals("mr")){
            System.out.println("用户名非法");
        }else if(!password.equals("mrsoft")){
            System.out.println("密码错误");
        }else{
            System.out.println("恭喜你,通过登录验证!");
        }
               

    }

}

条件语句模拟验证登录

标签:登录密码   line   imp   ati   port   int   class   user   登录验证   

原文地址:http://www.cnblogs.com/xiaofeng01/p/6837829.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!