Advertisement
myrdok123

04. Password Guess

Mar 16th, 2024
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P04PasswordGuess {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scanner = new Scanner(System.in);
  10.  
  11.         String password = scanner.nextLine();
  12.  
  13.  
  14.  
  15.         if(password.equals("s3cr3t!P@ssw0rd")){
  16.             System.out.println("Welcome");
  17.         } else {
  18.             System.out.println("Wrong password!");
  19.         }
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement