题目内容

What will be printed after the following code is executed?(下列代码执行后打印的结果是?)String str = "abc456"; int m = 0;while ( m < 6 ){if (Character.isLetter(str.charAt(m))) System.out.print(Character.toUpperCase(str.charAt(m)));m++;}

A. abc456
B. ABC456
C. ABC
D. 456

查看答案
更多问题

Assuming that str is declared as follows, (假设str声明如下)String str = "RSTUVWXYZ";What value will be returned from str.charAt(5)? (将从str.charAt(5)返回什么值?)

A. U
B. V
C. W
D. X

What will be the value of matches after the following code is executed? (执行以下代码后,匹配的值是多少?)boolean matches;String[] productCodes = {"456HI345", "3456hj"}; matches = productCodes[0].regionMatches(true, 1,productCodes[1], 2, 3);

A. 56H
B. 56h
C. true
D. false

What will be the value of loc after the following code is executed?(执行下列代码后,loc的值是多少?)int loc;String str = "The cow jumped over the moon."; loc = str.indexOf("ov");

A. 15
B. 16
C. 17
D. 18

In the following statement, what data type must recField be? (在下列语句中,recField必须是什么数据类型?)str.getChars(5, 10, recField, 0);

A. String
B. int
C. char
D. char[]

答案查题题库