标签:java ar sp on c html ef new r
Strings are constant; their values cannot be changed after they are created
String s1 = "Hello";
String s2 = "Hello";
System.out.println(s1==s2); //true
String s3 = new String("Hello");
String s4 = new String("Hello");
System.out.println(s3 == s4); //false
System.out.println(s3.equals(s4)); //true
char [] a = {‘a‘,‘b‘,‘c‘ ,‘d‘};
String s5 = new String(a);
String s6 = new String(a,1,3);
System.out.println(s5);
System.out.println(s6); //bcd
public String[] split(String regex)
标签:java ar sp on c html ef new r
原文地址:http://www.cnblogs.com/oraclespace/p/3983290.html