What are for loops used for?
Java Basic Data Structures

Quiz
•
Computers
•
6th - 10th Grade
•
Hard
Xander Ge
Used 182+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
To run a piece of code only when a certain condition is met
To run a piece of code repeatedly until a condition is met
To run a piece of code repeatedly forever
To run a piece of code if a condition isn't met
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How do you write a for loop?
for (int i = 0; i < 21) {}
for (int i = 0; i++) {}
for (int i = 0; i < 21; i++) {}
for (i) {}
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which is the right way to create an ArrayList of Integers?
ArrayList<Integer> list = new ArrayList<Integer>;
ArrayList Integer = new ArrayList();
Integer ArrayList = new Integer ArrayList();
ArrayList<Integer> list = new ArrayList<Integer>();
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How do you add 21 to an ArrayList of Integers?
list.add(21);
list.put(21);
21.add(list);
list.add("21");
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which is the right way to put 21 at the second position in an ArrayList of Integers?
(Remember zero-indexing!)
list.put(2, 21);
list.add(1, 21);
list.add(2, 21);
list.add(21, 1);
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you get the third element of an ArrayList?
(Remember zero-indexing!)
list.find(2);
list.get(3);
list.find(3);
list.get(2);
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does this code print out?
Nothing
0
1
2
3
3
2
1
0
2
1
0
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Very Basic Programming

Quiz
•
10th - 12th Grade
20 questions
Bài 11: KIỂU MẢNG MỘT CHỀU

Quiz
•
1st - 10th Grade
15 questions
Records and Files

Quiz
•
8th - 11th Grade
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
20 questions
AQA GCSE Computer Science Paper 1

Quiz
•
9th - 11th Grade
15 questions
Intro to Small Basic

Quiz
•
KG - 7th Grade
11 questions
Java ArrayLists

Quiz
•
10th Grade
15 questions
Computer Science - Python

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
20 questions
Final Exam Vocabulary

Quiz
•
6th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade