Java compareTo() 将OutputStream转换为String的Java程序 Java equals() Java compareTo() 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())); } } 将OutputStream转换为String的Java程序 Java equals()