使用String对象的indexOf()方法查找字符串”helloworld”中是否包含G,下列语句描述正确的是()。
A、字符串"helloworld"中不包含G字符,indexOf返回0
B、字符串"helloworld"中不包含G字符,indexOf返回null
C、字符串"helloworld"中不包含G字符,indexOf返回-1
D、字符串"helloworld"中不包含G字符,indexOf返回1
A、字符串"helloworld"中不包含G字符,indexOf返回0
B、字符串"helloworld"中不包含G字符,indexOf返回null
C、字符串"helloworld"中不包含G字符,indexOf返回-1
D、字符串"helloworld"中不包含G字符,indexOf返回1
A、charAt()方法是获取位于指定索引位置的字符 B、indexOf()方法是查找字符或字符串的位置,返回字符串出现的所有位置 C、charAt()方法的参数可以为一个或两个 D、indexOf()方法的参数为指定的索引值
A、A.常量字符串使用String,非常量字符串使用StringBuffer。 B、B.使用StringBuffer的时候设置初始容量。 C、C.尽量使用StringTokenizer代替indexOf()和substring()。 D、D.尽量不要使用StringBuffer,StringTokenizer类。
A、getParameter(String s) B、getValue(String s) C、getParameterNames(String s) D、getParameterValue(String s)
A、A.int m=s.indexOf(‘r’); B、B.char c=s.charAt(0); C、C.int n=s.length(); D、D.String str=s.append(‘2’);