相关代码 |
|
//compare.Java public class compare { public static void main(String args[]) { String s1=new String ("This is the first string"); String s2=new String ("This is the second string"); String s3=new String (s1); System.out.println("s1 compare s2="+s1.compareTo(s2)); System.out.println("s2 compare s3="+s2.compareToIgnoreCase(s3)); System.out.println("s1 compare s3="+s1.compareTo(s3)); } }
相关资源 |
|