
Java ArrayList
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
TIN HỌC 10 - BÀI 21
Quiz
•
10th Grade
12 questions
Tin học 2
Quiz
•
11th Grade
10 questions
ASJ XI-Bab 3 Remote Server
Quiz
•
11th Grade
12 questions
Kiểm tra giữa kì 2 lớp 7
Quiz
•
9th Grade
10 questions
Intro to Windows Server 2012
Quiz
•
12th Grade
15 questions
Mengenal Internet dan Jaringan Local
Quiz
•
12th Grade
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
10 questions
Ekstensi File (TIK kelas 9)
Quiz
•
9th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade
