public class Test {public static void main(String args[]){EqTest e = new EqTest();e.show();}}class EqTest{String s = "Java";String s2 = "java";public void show(){//在这儿放置测试代码{System.out.println("相等");}else{System.out.println("不相等");}}}在上面的Java代码的注释行位置,放置()测试代码能输出“相等”结果。(选一项)A、if(s==s2)B、if(s.equals(s2))C、if(s.equalsIgnoreCase(s2))D、if(s.noCaseMatch(s2))
public class Test {public static void main(String args[]){EqTest e = new EqTest();e.show();}}class EqTest{String s = "Java";String s2 = "java";public void show(){//在这儿放置测试代码{System.out.println("相等");}else{System.out.println("不相等");}}}在上面的Java代码的注释行位置,放置()测试代码能输出“相等”结果。(选一项)
A、if(s==s2)
B、if(s.equals(s2))
C、if(s.equalsIgnoreCase(s2))
D、if(s.noCaseMatch(s2))
发布时间:2024-06-28 09:48:42