Stringa=ABCD”;Stringb=a.toLowerCase();b.replace(‘a’,‘d’);b.replace(‘b’,‘c’);System.out.println(b);Whatistheresult?() A.abcdB.ABCDC.dccdD.dcbaE.Compilationfails.F.Anexceptionisthrownatruntime.

Stringa=ABCD”;Stringb=a.toLowerCase();b.replace(‘a’,‘d’);b.replace(‘b’,‘c’);System.out.println(b);Whatistheresult?()

A.abcd

B.ABCD

C.dccd

D.dcba

E.Compilationfails.

F.Anexceptionisthrownatruntime.


相关考题:

classParent{Stringone,two; classParent{Stringone,two;publicParent(Stringa,Stringb){one=a;two=b;}publicvoidprint(){System.out.println(one);}}publicclassChildextendsParent{publicChild(Stringa,Stringb){super(a,b);}publicvoidprint(){System.out.println(one+to+two);}publicstaticvoidmain(Stringarg[]){Parentp=newParent(south,north);Parentt=newChild(east,west);p.print();t.print();}}Whichofthefollowingiscorrect?()

Whichexpressionswillevaluatetotrueifprecededbythefollowingcode?()Stringa=hello;Stringb=newString(a);Stringc=a;char[]d={’h’,’e’,’l’,’l’,’o’}; A.(a==Hello)B.(a==b)C.(a==c)D.a.equals(b)E.a.equals(d)

Stringa=null;a.concat(abc”);a.concat(def”);System.out.println(a);Whatistheresult?() A.abcB.nullC.abcdefD.Compilationfails.E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

顺序执行下列程序语句后,则b的值是 String a="Hello"; String b=a.substring(0,2);A.HelloB.helloC.HeD.null

顺序执行下列程序语句后,则b的值是( )。 String a=Hello: String b=a.substring(0,2);A.HelloB.helloC.HelD.null

顺序执行下列程序语句后,则b的值是( )。 String a="Hello"; String b=a.substring(0,2);A.HelloB.helloC.HeD.null

下面()可实现刷新当前页面。A.reload()B.replace()C.href()D.referrer

下列代码的输出结果是什么? public static void main(String[] args) { String a = "110"; String b = "110"; String c = new String("110"); String d = new String(a); System.out.println(a == b); System.out.println(a == c); System.out.println(c == d); }A.true false falseB.true true trueC.true true falseD.编译错误

下列字符串函数中不可用于返回子字符串的是()。A.LEFT()B.REPLACE()C.RIGHT()D.SUBSTRING()