Java String endsWith() 方法 Java String copyValueOf(data, offset, count) Java String equals() 方法 Java String endsWith() 方法 public class Test { public static void main(String args[]) { String Str = new String("This is really not immutable!!"); boolean retVal; retVal = Str.endsWith( "immutable!!" ); System.out.println("Returned Value = " + retVal ); retVal = Str.endsWith( "immu" ); System.out.println("Returned Value = " + retVal ); } } Java String copyValueOf(data, offset, count) Java String equals() 方法