【单选题】阅读下面的Java代码int[] arr;int n = 5;n = n * 2 +1;arr = new int[n];System.out.println(arr.length);程序输出的结果是()
查看答案
【单选题】在Java语言中,下列代码的输出结果是()public static void main(String[] args) { int[] num={10,20,51,40,50}; System.out.println(num[2]);}
A. 40
B. 50
C. 51
D. 60
【单选题】在JAVA语言中,下列代码的运行结果是()public static void main(String args[]) { int stuAge[] = {18,22,26}; int i, avgAge = 0; for(i = 0; i < 3; i++){ avgAge += stuAge[i] / 3; } System.out.println( avgAge );}
A. 0
B. 9
C. 11
D. 21
【单选题】在Java语言中,下列对于字符数组的定义并赋值正确的是(B)
A. char[ ] name = new char[4];
B. char[ ] name = {'S','V','S','E'};
C. char[4] name = "SVSE";
D. char[4] name = {'S','V','S','E'};
【单选题】int a[] = {3,9,5,6,4};System.out.println(a[4]) ;以上JAVA程序段的输出结果为()
A. 3
B. 5
C. 4
D. 6