网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
语句“Hello”.equals(“hello”);的正确执行结果是( )。
A
true
B
false
C
0
D
1
参考答案
参考解析
解析:
equals()方法是比较两个字符串是否相等,其中区分字符串的大小写,因此比较的结果是Hello与hello两个字符串不相等,答案是false。
equals()方法是比较两个字符串是否相等,其中区分字符串的大小写,因此比较的结果是Hello与hello两个字符串不相等,答案是false。
更多 “单选题语句“Hello”.equals(“hello”);的正确执行结果是( )。A trueB falseC 0D 1” 相关考题
考题
假设有以下代码: String s="hello"; String t="hello"; char c[ ]={'h','e','l','l','o'}; 下列选项中,返回false的语句是______。A.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(new String("hello"));
考题
publicclassClassA{publicintgetValue(){intvalue=0;booleansetting=true;Stringtitle=”Hello”;(value||(settingtitle==Hello”)){return1;}(value==1title.equals(”Hello”)){return2;}}}And:ClassAa=newClassA();a.getValue();Whatistheresult?()A.1B.2C.Compilationfails.D.Thecoderunswithnooutput.E.Anexceptionisthrownatruntime.
考题
Strings=hello;Stringt=hello;charc[]={’h’,’e’,’l’,’l’,’o’};Whichreturntrue?()
A.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(newString(hello));E.t==c;
考题
下列代码的执行结果是()。publicclasstest5{publicstaticvoidmain(Stringargs[]){Strings1=newString("hello");Strings2=newString("hello");System.out.prim(s1==s2);System.out.print(",");System.out.println(s1.equals(s2));}A.true,falseB.true,trueC.false,trueD.false,false
考题
给出下列的代码,则以下哪个选项返回true? String s="hello"; String t="hello"; char c []= {'h','e','1','1','o'};A)s.equals(t);A.t. equals(B.;C.s==t;D.t==c;
考题
语句”Hello”.equals(”hello”);的正确执行结果是( )。A.trueB.falseC.0SXB
语句”Hello”.equals(”hello”);的正确执行结果是( )。A.trueB.falseC.0D.1
考题
语句"Hell0".equals("hell0");的正确执行结果是( )。 A.trueB.falseC.0SXB
语句"Hell0".equals("hell0");的正确执行结果是( )。A.trueB.falseC.0D.1
考题
设char str1[11]="HELLO,",str2[10]=“world”;则执行语句cout
设char str1[11]="HELLO,",str2[10]=“world”;则执行语句 cout<<strlen(strcpy(str1,str2)));后的输出结果是 ______。A.12B.11C.7D.5
考题
语句PrintFormat(“Hello World”,“”)的输出结果是()。A、hello WORLDB、hello worldC、HELLO WORLDD、HELLO world
考题
String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?() A、 s.equals(t);B、 t.equals(c);C、 s==t;D、 t.equals(new String("hello"));E、 t==c;
考题
单选题文本框Text1中有选定的文本,执行Text1.SelText=”Hello”的结果是( )。A
“Hello”将替换原来选定的文本B
“Hello”将插入到原来选定的文本之前C
Text1.SelLength为5D
文本框中只有“Hello”信息
考题
多选题String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?()As.equals(t);Bt.equals(c);Cs==t;Dt.equals(new String(hello));Et==c;
热门标签
最新试卷