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 分

创建提问


目录
打赏
0
0
0
0
10
分享
相关文章
|
10月前
|
SDUT java lab 7.3
SDUT java lab 7.3
32 0
|
10月前
|
sdut java lab 7.1(法二好理解)
sdut java lab 7.1(法二好理解)
73 1
sdut java lab6主观题
sdut java lab6主观题
57 0
|
10月前
|
sdut java lab7.2(法二)
sdut java lab7.2(法二)
57 0
|
10月前
|
SDUT java lab7.4
SDUT java lab7.4
51 0
|
10月前
|
SDUT JAVA lab3.9
SDUT JAVA lab3.9
61 2
|
10月前
|
SDUT Java lab6
SDUT Java lab6
37 0
|
10月前
|
sdut java lab7单选
sdut java lab7单选
62 0
|
10月前
|
sdut java lab 7.6
sdut java lab 7.6
62 0
|
26天前
|
【Java并发】【线程池】带你从0-1入门线程池
欢迎来到我的技术博客!我是一名热爱编程的开发者,梦想是编写高端CRUD应用。2025年我正在沉淀中,博客更新速度加快,期待与你一起成长。 线程池是一种复用线程资源的机制,通过预先创建一定数量的线程并管理其生命周期,避免频繁创建/销毁线程带来的性能开销。它解决了线程创建成本高、资源耗尽风险、响应速度慢和任务执行缺乏管理等问题。
157 60
【Java并发】【线程池】带你从0-1入门线程池