What does the following code create? int[] numbers = new int[5];

Array Basics Quiz

Quiz
•
Computers
•
7th - 11th Grade
•
Medium

Arasaka Teacher
Used 1+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An array that can store 5 decimal numbers
An array that can store 4 whole numbers
A single whole number variable with the value 5
An array that can store 5 whole numbers
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
After running int[] numbers = new int[5], what is the value of numbers[2]?
2
null
undefined
0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int[] scores = {85, 92, 78, 95, 88};
int x = scores[1] + scores[3];
System.out.println(x);
What is the output of the code above?
163
187
170
180
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int[] values = {4, 8, 12, 16};
values[2] = values[0] + values[1];
System.out.println(values[2]);
What is the output of the code above?
12
16
20
24
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given: int[] data = new int[4]; Which of these lines will cause an ArrayIndexOutOfBoundsException?
data[0] = 5;
data[3] = 12;
data[4] = 8;
data[2] = 15;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line correctly creates an array to store 6 string values?
String names[6];
String[] names = new String[6];
String[] names = 6;
names[] = new String[6];
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in an array?
1
-1
0
None of the above
Create a free account and access millions of resources
Similar Resources on Quizizz
25 questions
Penilaian Harian Bahasa Kotlin SMT 1 2023

Quiz
•
11th Grade
25 questions
AQA GCSE Programming

Quiz
•
10th Grade
25 questions
JavaScript Console & Graphics Review

Quiz
•
9th - 12th Grade
31 questions
Python Basics

Quiz
•
8th Grade
25 questions
Java Review

Quiz
•
9th Grade - University
25 questions
Mid-Year Java Check

Quiz
•
8th Grade
35 questions
SKT5 : Bab 3 : c) Standard Library, Subaturcara, Tatasusunan

Quiz
•
10th - 12th Grade
25 questions
Chapter 2 Review

Quiz
•
10th - 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
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
11 questions
Decimal/fraction conversions quick check

Quiz
•
5th - 7th Grade