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 pass = scanner.nextLine();
- String inputData = scanner.nextLine();
- while (!inputData.equals(pass)) {
- inputData = scanner.nextLine();
- }
- System.out.printf("Welcome %s!", username);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement