
Java Arrays Prt 1Quiz
Authored by Edwin Charikinya
Computers
9th - 12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of an array in Java?
To store multiple data types
To store a single value only
To create a collection of indexed like values
To link classes and objects
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default value assigned to elements in a newly created int array?
Null
-1
Random values
0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the valid way to declare and create an array in a single line?
int numbers; = new int[6];
int numbers = new int[];
int[] numbers = new int[6];
int[] = new int[6] numbers;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you access an array index that is out of bounds?
The value returned is null
Compilation error
ArrayIndexOutOfBoundsException
It returns the last element
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an off-by-one error?
Initialising array with a negative size
Accessing index from 0 to array.length
Declaring an array without specifying a size
Using the wrong data type
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the .length property of an array return?
Number of non-zero elements
Maximum index
Number of elements in the array
Total memory used by the array
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which loop is recommended for read-only access to all elements in an array?
while loop
do-while loop
enhanced for loop
nested loop
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
15 questions
Начала программирования на языке Паскаль
Quiz
•
8th - 11th Grade
20 questions
Online Platform Block Q
Quiz
•
11th - 12th Grade
15 questions
Chapter 3: Storage devices and media (Part 2):
Quiz
•
10th - 11th Grade
20 questions
City & Guilds Award in Business Processes
Quiz
•
12th Grade
10 questions
EMPTECH L4 Q2
Quiz
•
12th Grade
15 questions
11° Evaluación bimestral de informática
Quiz
•
11th Grade
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
10 questions
10 класс повторение CSS and Внедрение мультимедиа
Quiz
•
10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade