sdut java lab5

简介: sdut java lab5

An array subscript may be an integer or an integer expression. If a program uses an expression as a subscript, then the expression is evaluated to determine the particular element of the array.

T

答案正确:1 分

创建提问


1-2

分数 1

作者 翁恺

单位 浙江大学

There is a length() method for all the arrays to represent the number of elements

F

答案正确:1 分

创建提问


1-3

分数 1

作者 翁恺

单位 浙江大学

Arrays in Java can change its size as needed.

F

答案正确:1 分

创建提问

分数 2

作者 翁恺

单位 浙江大学

  1. Given a=new int[10], which expression below can cause ArrayIndexOutOfBoundsException?

A.

a[0] += 9;

B.

a[9]=10;

C.

a[9]

D.

for(int i=0;i<=10;i++) a[i]++;

答案正确:D 2 分


2-2

分数 2

作者 翁恺

单位 浙江大学

Given the following expression: int m[] = {0, 1, 2, 3, 4, 5, 6 };

Which result of the following expressions equals to the number of the array elements? ( )

A.

m.length()

B.

m.length

C.

m.length()+1

D.

m.length+1

答案正确:B 2 分


2-3

分数 2

作者 徐硕博

单位 浙江大学

What does the following line of code do?

quantity = new int[3];

A.

Creates storage for three doubles.

B.

Creates storage for three int.

C.

Creates storage for unlimited doubles.

D.

Creates storage for unlimited int

答案正确:B  2 分

创建提问


目录
相关文章
|
1月前
|
Java
SDUT JAVA lab3.9
SDUT JAVA lab3.9
32 2
|
1月前
|
Java
sdut java lab 7.1(法二好理解)
sdut java lab 7.1(法二好理解)
37 1
|
1月前
|
Java 应用服务中间件 AHAS
sdut java lab6主观题
sdut java lab6主观题
21 0
|
1月前
|
Java
SDUT Java lab6
SDUT Java lab6
12 0
|
1月前
|
Java
sdut java lab7单选
sdut java lab7单选
25 0
|
1月前
|
Java
sdut java lab7.2(法二)
sdut java lab7.2(法二)
28 0
|
1月前
|
存储 Java 索引
sdut java lab 7.6
sdut java lab 7.6
24 0
|
1月前
|
存储 Java
SDUT java lab7.4
SDUT java lab7.4
21 0
|
1月前
|
Java
SDUT java lab 7.3
SDUT java lab 7.3
19 0
|
1天前
|
存储 设计模式 并行计算
CopyOnWriteArrayList:深入理解Java中的线程安全List原理和应用
CopyOnWriteArrayList:深入理解Java中的线程安全List原理和应用
7 0