String.equals()对大小写敏感!
String.equalsIgnoreCase( )则忽略大小写!
public static void main(String[] args) {
System.out.println("aa".equals("AA"));
System.out.println("aa".equalsIgnoreCase("AA"));
}
结果
true
false
public static void main(String[] args) {
System.out.println("aa".equals("AA"));
System.out.println("aa".equalsIgnoreCase("AA"));
}
true
false