Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package WhileLoop;
- import java.util.Scanner;
- public class P02Password {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String username = scanner.nextLine();
- String password = scanner.nextLine();
- String input = scanner.nextLine();
- while (!input.equals(password)){
- input = scanner.nextLine();
- }
- System.out.printf("Welcome %s!", username);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement