Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean login(){
- Scanner sc = new Scanner(System.in);
- String input = "";
- boolean loggedIn = false;
- boolean continue = true;
- while(continue ){
- System.out.printlnl("Please enter your username: ");
- input = sc.nextLine();
- if(input.equals("Nick"){
- System.out.println("Please enter your password: ");
- input = sc.nextLine();
- if(input.equals("my password"){
- loggedIn = true;
- break;
- }
- }
- counter++;
- if(counter >= 3)
- continue = false;
- }
- return loggedIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement