Advertisement
sudoaptinstallname

Untitled

Jan 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.util.*;
  2.  
  3.  
  4. /*
  5. Amon Guinan
  6.  
  7. Password Checker.
  8. User inputs two strings and the program confirms they are the same.
  9.  
  10. January 15, 2019.
  11. */
  12. public class New_Password {
  13. public static void main(String[] args) {
  14.  
  15. Scanner input = new Scanner(System.in);
  16.  
  17. System.out.print("Enter your password choice:");
  18. String first = input.nextLine();
  19.  
  20. System.out.print("Enter the same password again:");
  21. String second = input.nextLine();
  22.  
  23. if(Objects.equals(first,second))
  24. {
  25. System.out.print("You are now a registered user.");
  26. }
  27. else
  28. {
  29. System.out.print("Sorry, the passwords do not match.");
  30. }
  31.  
  32.  
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement