...
Code Block | ||
---|---|---|
| ||
public class GoodComparison {
public static void main(String[] args) {
String one = new String("one");
String two = new String("one");
boolean result;
if (one == null){
result = two == null || two.equals(one);
}
else{
result = one == two || one.equals(two);
}
System.out.println(result);
}
}
|
...