public class Test
{
public static void main(String[] args) {
String a =
"hello2";
final String b = "hello";
String d =
"hello";
String c = b + 2;
String e = d + 2;
System.out.println((a == c));
System.out.println((a ==
e));
}
The
result is True and False.
Does "==" not mean that the string address is
equal?
I think the result is False Fasle
No comments:
Post a Comment