执行代码Strings=newString("Hello")后,正确的结论是()A、s最后一个索引值为5B、s的值和"Hello"并不一样C、s.length为4D、s.length为5

执行代码Strings=newString("Hello")后,正确的结论是()

  • A、s最后一个索引值为5
  • B、s的值和"Hello"并不一样
  • C、s.length为4
  • D、s.length为5

相关考题:

定义String s=null,会出现异常的选项是()。Ⅰ: if((s!=mll)(s.length()>0))Ⅱ: if((s!=mull)(s.length()>0)) Ⅱ: if((s!=mull)(s.length()>0)) Ⅲ: if((s==null)|(s.length()==0)) Ⅳ: if((s==aull)Ⅱ(s.length()==0))A.Ⅱ、ⅢB.Ⅱ、Ⅲ、ⅣC.Ⅰ、ⅢD.Ⅲ、Ⅳ

执行下列代码后,哪个结论是正确的String[]s=newString[10];()A、s[10]为““;B、s[9]为null;C、s[0]为未定义D、s.length为10

已知“chars[10]="hello";”,则s[5]的值为'\0'。() 此题为判断题(对,错)。

执行下列代码后,哪个结论是正确的String[]s=newString[10];()A、[10]为"";B、[9]为null;C、[0]为未定义D、lengtH为10

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;

publicclassX{publicstaticvoidmain(String[]args){strings=newstring(Hello”);modify(s);System.out.printIn(s);}publicstaticvoidmodify(Strings){s+=world!”;}}Whatistheresult?() A.Theprogramrunsandprints“Hello”B.Anerrorcausescompilationtofail.C.Theprogramrunsandprints“Helloworld!”D.Theprogramrunsbutabortswithanexception.

publicclassX{publicstaticvoidmain(Stringargs){strings=newstring(Hello”);modify(s);System.out.printIn(s);}publicstaticvoidmodify(Strings){s+=world!”;}}Whatistheresult?() A.Theprogramrunsandprints“Hello”B.Anerrorcausescompilationtofail.C.Theprogramrunsandprints“Helloworld!”D.Theprogramrunsbutabortswithanexception.

下列代码的执行结果是()。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

已知有如下语句: s="hello, world" r=Mid(s,7,5) 运行上面的语句后,变量r的值为 ( )A.helloB.wotldC.llo,wD.orld

已知有定义:Strings="story",下面()表达式是合法的。A.s+="books";B.charC=s[1];C.intlen=s.length;D.Strings=s.toLowerCase();

设有定义:Strings=“World”;,下列语句错误的是( )。A、intm=s.indexOf(‘r’);B、charc=s.charAt(0);C、intn=s.length();D、Stringstr=s.append(‘2’);

下面哪个表达式可以获取字符串 s 的最后一个字符()A、s.length()B、s[s.length() - 1]C、s.charAt(s.length() - 1)D、charAt(s, length(s))

设Strings="story";下列选项中的语句书写正确的是()。A、s+="books";B、char c = s[1];C、int len = s.length;D、s = s-"books";

执行下列代码后,()结论是正确的。 String[]s=newString[10];A、s[10]为"";B、s[9]为null;C、s[0]为未定义D、s.length为10

创建字符串s:Strings=newString(“hello”);以下()语句将改变s。A、s.append(“aaa”)B、s.concat(s)C、s.substring(3)D、以上语句都不会

("%s"%"hello")的返回值是()A、helloB、%sC、%s%D、hello%

有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”

已知Strings=“Java”,则下面哪些代码是正确的()A、s=s+1;B、char c=s[3];C、int i=s.length;D、String t=s+new Object();

单选题有语句String s=”hello world”; ,以下操作哪个是不合法的()Aint i=s.length();Bs=3;CString ts=s.trim();DString t=s+”!”

多选题执行下列代码后,()结论是正确的。 String[]s=newString[10];As[10]为;Bs[9]为null;Cs[0]为未定义Ds.length为10

单选题创建字符串s:Strings=newString(“hello”);以下()语句将改变s。As.append(“aaa”)Bs.concat(s)Cs.substring(3)D以上语句都不会

单选题执行代码Strings=newString("Hello")后,正确的结论是()As最后一个索引值为5Bs的值和Hello并不一样Cs.length为4Ds.length为5

单选题下面哪个表达式可以获取字符串 s 的最后一个字符()As.length()Bs[s.length() - 1]Cs.charAt(s.length() - 1)DcharAt(s, length(s))

单选题有语句Strings=”helloworld”;,以下操作哪个是不合法的?()Ainti=s.length()Bs=3CStringts=s.trim()DStringt=s+”!”

单选题SQL server提供了一些字符串函数,以下说法错误的是()。Aselectright(’hello’,3)返回值为:helBselectltrim(rtrim(’hello’))返回值为:hello(前后都无空格)Cselectreplace(’hello’,’e’,’o’)返回值为:holloDselectlen(’hello’)返回值为:5

多选题已知Strings=“Java”,则下面哪些代码是正确的()As=s+1;Bchar c=s[3];Cint i=s.length;DString t=s+new Object();

单选题设Strings="story";下列选项中的语句书写正确的是()。As+=books;Bchar c = s[1];Cint len = s.length;Ds = s-books;