Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- /*
- Amon Guinan
- Password Checker.
- User inputs two strings and the program confirms they are the same.
- January 15, 2019.
- */
- public class New_Password {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter your password choice:");
- String first = input.nextLine();
- System.out.print("Enter the same password again:");
- String second = input.nextLine();
- if(Objects.equals(first,second))
- {
- System.out.print("You are now a registered user.");
- }
- else
- {
- System.out.print("Sorry, the passwords do not match.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement