Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ConditionalStatements;
- import java.util.Scanner;
- public class P05PasswordGuess {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- //s3cr3t!P@ssw0rd
- boolean isValid = input.equals("s3cr3t!P@ssw0rd");
- if (isValid) {
- System.out.println("Welcome");
- } else {
- System.out.println("Wrong password!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement