Just switched to Java from php
I encountered following issue
I want to rewrite
if(usrname.equals(username) && (passwd.equals(password))){
By the way you can simplify:
return (usrname.equals(username) && passwd.equals(password) )? return true : return false;
To:
return usrname.equals(username) && passwd.equals(password);
The ternary operator work similar in php than Java, I think you have made a silly mistake, maybe "username" have a space or another white character
String a1 = "a";
String b1 = "b";
String a2 = "a";
String b2 = "b";
System.out.println((a1.equals(a2)&&b1.equals(b2))?"true":"false");
it return "true"