ArrayLists

Quiz
•
Computers
•
11th - 12th Grade
•
Medium
Lauren Olson
Used 60+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will print when the code executes?
List<Integer> list1 = new ArrayList<Integer>();
list1.add(new Integer(1));
list1.add(new Integer(2));
list1.add(new Integer(3));
list1.add(2, new Integer(4));
list1.add(new Integer(5));
System.out.println(list1);
[1, 2, 3, 4, 5]
[1, 4, 2, 3, 5]
[1, 2, 4, 3, 5]
[1, 2, 4, 5]
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will print?
List<String> list1 = new ArrayList<String>();
list1.add("Anaya");
list1.add("Layla");
list1.add("Sharrie");
list1.add(1, "Sarah");
System.out.println(list1);
["Anaya", "Sarah", "Layla", "Sharrie"]
["Anaya", "Layla", "Sharrie", "Sarah"]
["Sarah", "Anyar", "Layla", "Sarah"]
["Anaya", "Layla", "Sarah","Sharrie", ]
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be printed?
List<Integer> list1 = new ArrayList<Integer>();
list1.add(5);
list1.add(4);
list1.add(3);
list1.add(1, 2);
System.out.println(list1);
[5, 4, 3, 2]
[5, 4, 1, 3]
[2, 5, 4, 3]
[5, 2, 4, 3]
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be printed?
List<Integer> list1 = new ArrayList<Integer>();
list1.add(1);
list1.add(3);
list1.add(2);
list1.add(1);
System.out.println(list1);
[1, 3, 2]
[1, 3, 2, 1]
[1, 1, 2, 3]
[1, 2, 3]
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be printed?
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, 3, 4, 5]
[1, 2, 4, 5, 6]
[1, 2, 5, 4, 6]
[1, 5, 2, 4, 6]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be printed?
List<String> list1 = new ArrayList<String>();
list1.add("Anaya");
list1.add("Layla");
list1.add("Sharrie");
list1.set(1, "Destini");
list1.add(1, "Sarah");
System.out.println(list1);
["Sarah", "Destini", "Layla", "Sharrie"]
["Sarah", "Destini", "Anaya", "Layla", "Sharrie"]
["Anaya", "Sarah", "Sharrie"]
["Anaya", "Sarah", "Destini", "Sharrie"]
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be printed?
List<Integer> numList = new ArrayList<Integer>();
numList.add(new Integer(1));
numList.add(new Integer(2));
numList.add(new Integer(3));
numList.set(2,new Integer(4));
numList.add(1, new Integer(5));
numList.add(new Integer(6));
System.out.println(numList);
[1, 2, 3, 4, 5]
[1, 2, 4, 5, 6]
[1, 2, 5, 4, 6]
[1, 5, 2, 4, 6]
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Python List Quiz

Quiz
•
11th Grade
15 questions
Python Lists

Quiz
•
10th - 12th Grade
10 questions
Master curs 1

Quiz
•
12th Grade
15 questions
Python Revision Tour - I

Quiz
•
12th Grade
15 questions
list in python

Quiz
•
10th - 12th Grade
10 questions
Python lists and tuples

Quiz
•
12th Grade
15 questions
Computer Science - Python

Quiz
•
9th - 12th Grade
10 questions
Python Quiz for Grade 11 List, Tuple & Strings

Quiz
•
11th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade