You can do
return (usrname.equals(username) && passwd.equals(password) )? true : false;
true
and false
can be replaced by any return value you want. If it is just boolean then you can avoid ternary operator altogether. Just do
return (usrname.equals(username) && passwd.equals(password));