String s = "loveyou";
char[] c = {'l','o','v','e','y','o','u'};
String str = new String( c );
if( s.equals( str ) )
//相等
else
//不相等
char[] c = {'l','o','v','e','y','o','u'};
String str = new String( c );
if( s.equals( str ) )
//相等
else
//不相等
调试欢乐多
char[] c = {'l','o','v','e','y','o','u'};
if(s.equals(String.valueOf(c))){
System.out.println("yes"); }else{
System.out.println("no");
}
String s="abcd";String s1=new String(c);判断: if( s.equals(s1)) {......}