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[]
This character is one that appears at the end, or right side, of a string, after the non-space characters:(这个字符出现在字符串的末尾或右侧,非空格字符之后:)
A. Leading whitespace(前导空格)
B. Carriage return(回车)
C. Trailing whitespace (尾部空格)
D. Line feed(换行)
When you are writing a program with String objects that may have unwanted spaces at the beginning or end of the strings, use this method to delete them.(当你使用字符串对象编程时,字符串的开头或结尾可能有不需要的空格,使用什么方法删除它们?)
A. replace (替换)
B. trim (修剪)
C. valueOf (返回对象的值)
D. substring (子串)