What is an array in Java?

Java Arrays Quiz

Quiz
•
Information Technology (IT)
•
12th Grade
•
Hard
Harwin Mendoza
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A collection of elements of different types
A collection of elements of the same type
A class in Java
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How are arrays declared in Java?
int arr = new int[5];
int[] arr = new int[5];
int arr = {1, 2, 3};
array int[5] arr;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if you access an array index out of bounds?
Compilation error
Returns -1
Runtime exception
Undefined behavior
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you get the length of an array in Java?
arr.size()
arr.length
arr.length()
arr.getLength()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following initializes an array correctly?
int[] arr = new int[5]{1, 2, 3, 4, 5};
int arr = {1, 2, 3, 4, 5};
int arr[] = {1, 2, 3, 4, 5};
int arr(5) = {1, 2, 3, 4, 5};
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can an array size be changed after declaration in Java?
Yes
No
Only for primitive types
Only for object types
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a multidimensional array in Java?
int[][] arr = new int[3][3];
int arr[][] = {1, 2, 3, 4};
int[] arr = new int[3][3];
array[][]int arr;
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
QUIZ in JAVA METHOD

Quiz
•
12th Grade
10 questions
3F_14042025_Verifica per orale Informatica

Quiz
•
11th Grade - University
15 questions
PBO Kelas XI | Mengenal Tipe Data pada Java

Quiz
•
12th Grade
15 questions
Python for loop/lists

Quiz
•
9th Grade - University
10 questions
Quiz de Programação em C

Quiz
•
9th - 12th Grade
18 questions
IT tutor

Quiz
•
12th Grade
20 questions
Mastering C: Control Structures and More

Quiz
•
12th Grade
15 questions
Mastering Pointers and Functions

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade