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 分

创建提问

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值