I am unable to return both username and pass String
values at the same time.
public static String executeLogin(String username, String pass) {
int totalAttempts = 5;
if (totalAttempts != 0) {
if (username == "Javaprogram" && (pass == "Legend1@")) {
System.out.println("Correct");
} else {
System.out.println("Incorrect Login");
totalAttempts--;
}
if (totalAttempts == 0) {
System.out.println("Maximum number of attempts exceeded");
}
}
return "username,pass";
}