04/03/03 23:47
以下のコードを実行した場合の結果はどのようになるか?
class Test {
public static void main(String args[]){
String a = new String("test");
String b = new String("test");
if(a == b) {
System.out.print("a");
}
if(a.equals(b)){
System.out.print("b");
}
}
}
1.a
2.b
3.ab
4.表示なし