Java ArrayList

Java ArrayList

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

KUIS BAHASA SURAT

KUIS BAHASA SURAT

11th Grade

15 Qs

Program Efficiency 2

Program Efficiency 2

12th Grade

15 Qs

SJiWP - 2022 - 07 (PHP osnove)

SJiWP - 2022 - 07 (PHP osnove)

11th Grade

11 Qs

TLE 10 quiz 2021

TLE 10 quiz 2021

10th Grade

10 Qs

Operating Systems

Operating Systems

12th Grade

10 Qs

ΤΥΥΣΔΥ Κ4.1 Προβλήματα NIC TCPIP Switch

ΤΥΥΣΔΥ Κ4.1 Προβλήματα NIC TCPIP Switch

12th Grade

10 Qs

pemahaman google classroom

pemahaman google classroom

1st Grade - University

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?