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 (子串)
现有:public class Tester {public static void main(String[] args) {int x = 5;Integer x1 = x;Integer x2 = x;int x3 = new Integer(5);System.out.print(x1.equals(x));System.out.print(x1 == x);System.out.print(x2.equals(x1));System.out.print(x2 == x1);System.out.print(x2 == x3);System.out.print(x2.equals(x3));}}结果为:
A. 编译失败
B. falsefalsetruetruetruetrue
C. truetruetruetruetruetrue
D. falsefalsetruetruetruefalse
E. truefalsetruefalsefalsetrue
F. 运行时异常被抛出
String foo="blue";boolean[] bar=new boolean[1];if(bar[0]){foo="green";}foo的值是多少? ( )
A. ""
B. null
C. blue
D. green
int index=1;String[] test=new String[3];String foo=test[index];foo的值是多少? ( )
A. ""
B. null
C. throw Exception
D. not compile