posts - 14,  comments - 7,  trackbacks - 0
代码如下:
package com.dr.exercise6;

import java.util.Scanner;

public class Login {
    
public static void main(String[] args) {
        Scanner s 
= new Scanner(System.in);
        System.out.println(
"请输入用户名:");
        String name 
= s.nextLine();
        System.out.println(
"请输入密码:");
        String password 
= s.nextLine();
        
if(name.equals("abc")&&password.equals("123")){
            System.out.println(
"欢迎登入!!");
            
        }

        
else{
            System.out.println(
"用户名或密码不正确!!");
        }


    }


}

用户名密码输入正确时:
用户名或密码输入不正确时:
posted on 2010-10-20 16:33 迷人笑笑 阅读(600) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2010年10月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(13)

随笔档案

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜