全国信息技术应用考试

indexOf(Strings,intbegin_index)是从字符串s中第begin_index+1字符处开始检索

题目

indexOf(Strings,intbegin_index)是从字符串s中第begin_index+1字符处开始检索

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

在Java语言中,下列语句能通过编译的是()。

A.Strings="john"+"was"+"here";

B.Strings="john"+3;

C.inta=3+5;

D.inta=5+5.5;


参考答案:A, B, C

第2题:

Giventhatcisareferencetoavalidjava.io.Consoleobject,whichtwocodefragmentsreadalineoftextfromtheconsole?()

A.Strings=c.readLine();

B.char[]c=c.readLine();

C.Strings=c.readConsole();

D.char[]c=c.readConsole();

E.Strings=c.readLine("%s","name");

F.char[]c=c.readLine("%s","name");


参考答案:A, E

第3题:

下面哪段语法执行正确()

A.Strings="Gonewiththewind";Stringt="good";Stringk=s+t;

B.Strings="Gonewiththewind";Stringt;t=s[3]+"one";

C.Strings="Gonewiththewind";Stringstandard=s.toUpperCase();

D.Strings="homedirectory";Stringt=s-"directory";


参考答案:A, C

第4题:

下面这段代码会产生( )个String对象。

Strings1="hello";

Strings2=s1.substring(2,3);

Strings3=s1.toString();

Strings4=newStringBuffer(s1).toString();

A、1

B、2

C、3

D、4


正确答案:C

第5题:

Why we use StringBuffer when concatenating strings?


正确答案:
        

第6题:

已知Strings="ABCDEFGHIJABC",以下说法错误的是()

A.s.indexOf("C")等于2

B.s.indexOf("EFG",2)等于4

C.s.indexOf("A",7)等于10

D.s.indexOf("D",4)等于3


正确答案:D

第7题:

importjava.util.*;publicclassLetterASort{publicstaticvoidmain(String[]args){ArrayListstrings=newArrayList();strings.add(?aAaA”);strings.add(”AaA”);strings.add(?aAa”);strings.add(”AAaa”);Collections.sort(strings);for(Strings:strings){System.out.print(s+);}}}Whatistheresult?()

A.Compilationfails.

B.aAaAaAaAAaaAaA

C.AAaaAaAaAaaAaA

D.AaAAAaaaAaAaAa

E.aAaAaAaAaAAAaa

F.Anexceptionisthrownatruntime.


参考答案:C

第8题:

在JAVA中,如果要在字符串类型对象S=”JAVA”,中找出字母“v”出现的位置(即位置2),可使用()

A.mid(2,s)

B.charAt(2)

C.s.indexOf(“v”)

D.indexOf(s,”v”)


参考答案:C

第9题:

已知有定义:Strings="story",下面()表达式是合法的。

A.s+="books";

B.charC=s[1];

C.intlen=s.length;

D.Strings=s.toLowerCase();


正确答案:A

第10题:

设有定义:Strings=“World”;,下列语句错误的是( )。

A、intm=s.indexOf(‘r’);

B、charc=s.charAt(0);

C、intn=s.length();

D、Stringstr=s.append(‘2’);


正确答案:D

更多相关问题