This program always says "ERROR: PIN not correct" even I enter the "CORRECT" PIN,
I used "debugger" (IntelliJ) to see where mistakes are but I saw nothing. Debugger shows me they are same but anyway it shows me that they are not same things. Thanks in advance
public static void main (String args [])
{
java.util.Scanner input = new java.util.Scanner (System.in);
int acctNums [] = new int [] {12345 , 67890};
String acctNames [] = new String []{"Mr Isk." , "Other"};
String acctPINs [] = new String [] {"0101" , "9876"};
double acctBalances [] = new double [] {10000.0 , 250.0};
ATM.login(acctNums , acctNames , acctPINs , acctBalances);
}
public static void login (int acctNums [] , String acctNames [] , String acctPINs [] , double acctBalances [])
{
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.println("Please enter your account number");
int acctNum = input.nextInt();
int index = 0;
if(findAccount(acctNums , acctNum) == -1) {
System.out.println("ERROR: Account not found");
System.exit(0);
}
else
for(index = 0 ; index<acctNums.length; index++)
if(findAccount(acctNums , acctNum) == index)
break;
System.out.println("Please enter your PIN");
String PIN = input.next();
if(acctPINs[index] == PIN)
System.out.println("Hello" + acctNames[index] + "What would you like to do today?");
else
System.out.println("ERROR: PIN not correct");
System.exit(0);
}