veronikaaa86

04. Password Guess

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