Java ArrayList

Java ArrayList

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

OCR GCSE CS - 2.1 ERL sorts and searches

OCR GCSE CS - 2.1 ERL sorts and searches

10th - 11th Grade

9 Qs

Stepwise Refinement

Stepwise Refinement

11th - 12th Grade

13 Qs

Kiểm tra thường xuyên tin học 11A1

Kiểm tra thường xuyên tin học 11A1

11th Grade

15 Qs

Ayo Belajar Agile

Ayo Belajar Agile

9th - 12th Grade

10 Qs

Computer Quiz For NM(06.05.2021)

Computer Quiz For NM(06.05.2021)

11th - 12th Grade

15 Qs

Thiết kế 3D trên Tinkercad

Thiết kế 3D trên Tinkercad

6th - 9th Grade

12 Qs

1.1.1 The structure and function of the processor

1.1.1 The structure and function of the processor

11th Grade - University

15 Qs

Tin 12 - Bài 1 - Củng cố

Tin 12 - Bài 1 - Củng cố

12th Grade

10 Qs

Java ArrayList

Java ArrayList

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Wendy Dyer

Used 10+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to set the second value in an array called nums to 5?

nums[1] = 5;

nums[5] = 1;

nums[0] = 5;

nums[5] = 0;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which index is the last element in a list called nums at?

nums.size- 1

nums.size()

nums.size

nums.size() - 1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to add 2 between the 1 and 3 in the following list nums =[1,3,4]?

nums.add(0, 2);

nums.add(2, 1);

nums.add(1, 2);

nums.add(2, 0);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will print when the following code executes?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(new Integer(1));

list1.add(new Integer(2));

list1.add(new Integer(3));

list1.remove(1);

System.out.println(list1);

[1, 2]

[1, 3]

[1, 1]

[2, 3]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to get the second value in a list called nums?

nums.get(0)

nums.get(2)

nums.get(3)

nums.get(1)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed as a result of executing the following code segment?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(new Integer(1));

list1.add(new Integer(2));

list1.add(new Integer(3));

list1.set(2, new Integer(4));

list1.add(2, new Integer(5));

list1.add(new Integer(6));

System.out.println(list1);

[1, 2, 5, 4, 6]

[1, 2, 3, 4, 6]

[1, 2, 4, 5, 6]

[1, 2, 3, 4, 5, 6]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to set the second value in a list called nums to 5?

nums.add(1, 5);

nums.add(2, 5);

nums.set(1, 5);

nums.set(2, 5);

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?