Cant seem to get logic to work when checking login info

when I concatenate the end of the line: (accountNumber ==
BankAccount.accounts[i]) && (accountPassword ==
BankAccount.passwords[i])  without the && statement things seem to
work. I wonder why this is and why I can’t check both values.