I'm still newbie to java programming. And can anybody tell me what's wrong with the source code? When I run the code, the conditional assignment always outputs "login failed".
import java.util.Scanner;
public class ProgramBiodataMahasiswa {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String username, password, output;
System.out.print("Enter username : ");
username = input.nextLine();
System.out.print("Enter password : ");
password = input.nextLine();
output = (username=="kesit" && password=="ps123") ? "login successfully" : "login failed" ;
System.out.println(output);
}
}