Java ArrayList

Java ArrayList

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Përdorimi i sigurt i internetit. Platforma eTwinning

Përdorimi i sigurt i internetit. Platforma eTwinning

5th - 12th Grade

15 Qs

Итоговый урок III четверти. 8 класс

Итоговый урок III четверти. 8 класс

10th Grade

14 Qs

8 клас Цикли

8 клас Цикли

8th - 9th Grade

10 Qs

Ulangan Harian 1 - Informatika 7B

Ulangan Harian 1 - Informatika 7B

10th - 12th Grade

10 Qs

Database Features

Database Features

11th Grade

15 Qs

Bài tập Tin học 11 (Tiết 6)

Bài tập Tin học 11 (Tiết 6)

11th Grade

13 Qs

Excel - basic

Excel - basic

9th Grade

15 Qs

Binary representation revision

Binary representation revision

9th - 10th Grade

10 Qs

Java ArrayList

Java ArrayList

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Wendy Dyer

Used 10+ times

FREE Resource

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);

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?