Java示例比较两个字符串 Java.io.ObjectInputStream.getField.get Short() 方法 Java示例字符串比较equals() Java示例比较两个字符串 public class StringCompareEmp{ public static void main(String args[]) { String str = "Hello World"; String anotherString = "hello world"; Object objStr = str; System.out.println( str.compareTo(anotherString) ); System.out.println( str.compareToIgnoreCase(anotherString) ); System.out.println( str.compareTo(objStr.toString())); } } 363 236 Java.io.ObjectInputStream.getField.get Short() 方法 Java示例字符串比较equals()