wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java101 Chapter 06 Array and ArrayList

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

ข้อใดคือคำส่ังสร้าง Array?

a)

int intID [ ] = {1,2,3}

b)

Array int intID [ ] = {1,2,3}

c)

int iArray ntID = {1,2,3}

d)

Array intID [ ] = int {1,2,3}

2.

ดัชนีชี้ตำแหน่งของ Array เริ่มต้นที่ค่าอะไร ?

a)

1

b)

ตามที่ผู้ใช้กำหนดแต่ >0

c)

0

d)

ตามท่ีผู้ใช้กำหนดแต่ >1

3.

มีวิธีการกำหนดค่าให้กับ Array ก่ีวิธี?

a)

2 วิธี

b)

4 วิธี

c)

3 วิธี

d)

วิธีเดียว

4.

ข้อใดคือ Method ท่ีใช้วัดจำนวนข้อมูลของ Array?

a)

long

b)

length

c)

size

d)

capacity

5.

ข้อใดถูกต้อง?

a)

Array เก็บข้อมูลวัตถุ

b)

ArrayList ค่าน้อยกว่า Array

c)

ArrayList เก็บค่าข้อมูล

d)

ArrayList เก็บข้อมูลวัตถุ

6.

(Class) ArrayList อยู่ใน Package ใด ?

a)

java.data

b)

java.util

c)

java.arraylist

d)

java.array

7.

ค่าดัชนีของ ArrayList เริ่มต้นท่ีค่าเท่าใด?

a)

ผู้ใช้สามารกำหนดได้

b)

0

c)

a

d)

1

8.

ArrayList ใช้ Method ใดในการเพิ่มข้อมูล?

a)

add

b)

new

c)

insert

d)

;

9.

ArrayList ใช้ Method ใดในการลบข้อมูล?

a)

delete

b)

undo

c)

remove

d)

erase

10.

ArrayList ใช้ Method ใดในการดึงข้อมูลมาใช้งาน?

a)

take

b)

get

c)

read

d)

show