Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FirstScanner {
- public static void main(String[] args)
- {
- final String USERNAME="ayob";
- final String PASSWORD="12345" ;
- Scanner GetUserCredintials= new Scanner(System.in);
- boolean Fail=true;
- String UserTemp="" ;
- String PasswordTemp="";
- do
- {
- System.out.print(" Insert your User Name :" );
- UserTemp=GetUserCredintials.nextLine();
- System.out.print(" Insert your password :" );
- PasswordTemp=GetUserCredintials.nextLine();
- Fail=(((UserTemp.toLowerCase().equals(USERNAME)&&(PasswordTemp.toLowerCase().equals(PASSWORD))? false :true )));
- if( !Fail)
- {
- System.out.println(" You Are Login " );
- break ;
- }
- else
- System.out.println(" Wrong UserName Or Password ..Please Try Again " );
- } while(Fail );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement