Are both the String comparison methods below considered to be equal
public class TestString {
public static final String CONSTVAL="foo";
public boolean testString1(String testVal) {
return testVal.equalsIgnoreCase(CONSTVAL);
}
public boolean testString2(String testVal) {
return CONSTVAL.equalsIgnoreCase(testVal);
}
}
or should one type of comparison be favoured over another?