Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Login {
- public static void main(String[]args) {
- String username = "BruceLee";
- String password1 = "ilovemum9";
- String usernameInput;
- String password1Input;
- Scanner input = new Scanner(System.in);
- System.out.println("Please enter your username to Login");
- usernameInput = input.nextLine();
- System.out.println("Please enter your password");
- password1Input = input.nextLine();
- loginLogic(username, password1, usernameInput, password1Input );
- }
- public static void loginLogic(String username, String password1, String usernameInput,String password1Input ){
- if(username.equals(usernameInput) && password1.equals(password1Input)) {
- System.out.println("Welcome "+username+" You are logged in");
- }
- else {
- System.out.println("Wrong credentials, try again");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement