
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
What is an array in Java?
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 Wayground
12 questions
Skill #2 Array

Quiz
•
12th Grade
16 questions
Kuis Uji Pemahaman Python Variabel, Sintaks Dasar, Type Data

Quiz
•
11th Grade - University
20 questions
Quiz Struktur Data

Quiz
•
9th Grade - University
14 questions
C++ QUIZ

Quiz
•
12th Grade
15 questions
programmazione fino ai cicli 3C

Quiz
•
11th Grade - University
20 questions
Kelas 9 - Halaman 23 (UH Bab 1)

Quiz
•
9th Grade - University
20 questions
Uji Pemahaman Array dan Fungsi

Quiz
•
11th Grade - University
10 questions
Basics of C Programming

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
6 questions
Rule of Law

Quiz
•
6th - 12th Grade
15 questions
ACT Math Practice Test

Quiz
•
9th - 12th Grade
18 questions
Hispanic Heritage Month

Quiz
•
KG - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
10 questions
Would you rather...

Quiz
•
KG - University
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade