Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import java.util.*;
  2. public class OneNine
  3. {
  4. public static void mian (String[]args)
  5. {
  6. String username = "Test123";
  7. String password = "password";
  8. Scanner input = new Scanner(System.in);
  9. Scanner enter = new Scanner(System.in);
  10. System.out.println("Enter your username then password");
  11. String prompt;
  12. prompt = enter.nextLine();
  13. String promptpass;
  14. promptpass = enter.nextLine();
  15. if((prompt.equals(username))&&(promptpass.equals(password)))
  16. {
  17. System.out.println("You have successfully logged in!");
  18. }
  19. else
  20. {
  21. System.out.println("Either password or username incorrect, try again!");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement