package
WrappProg;
public
class
equal212 {
public
static
void
main(String[] args) {
String str1 =
"imooc"
;
String str2 =
"imooc"
;
String str3 =
new
String(
"imooc"
);
System.out.println(
"str1 and str1 num? "
+(str1.equals(str2)));
System.out.println(
"str1 and str3 num? "
+(str1.equals(str3)));
System.out.println(
"str2 and str3 num? "
+(str2.equals(str3)));
System.out.println(
"str1 and str1 maps? "
+(str1==str2));
System.out.println(
"str1 and str3 maps? "
+(str1==str3));
System.out.println(
"str2 and str3 maps? "
+(str2==str3));
}
}
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧