题目内容

Given that String[] str has been initialized, to get a copy of str[0] with all characters converted to upper case, use the following statement: 给定字符串[]str已经被初始化,要获得str[0]的一个副本,并将所有字符转换为大写,请使用以下语句:

A. str.uppercase();
B. str[0].upperCase();
C. str.toUpperCase();
D. str[0].toUpperCase();

查看答案
更多问题

已知数组array,其最后一个元素的下标是?

A. array. size
B. array. length-1
C. array. size-1
D. array.length

现有:class Rectangle {public static void main(String[] args) {int[] x = { 1, 2, 3 };x[1] = (x[1] > 1) ? x[2] : 0;System.out.println(x[1]);}}结果为:

A. 3
B. 2
C. 1
D. 0

int index=1;int foo[]=new int[3];int bar=foo[index];int baz=bar+index;经过以上代码后,baz的值是多少?( )

A. baz值为 0
B. baz值为1
C. baz值为2
D. 程序运行时抛出异常
E. 代码不能编译

数组定义int[][]num={{7,8,1,2,3,4},{9,10,11,12,30,50,60},{16,20,70},{0}};,则num.length的值为()

A. 3
B. 4
C. 6
D. 7

答案查题题库