Java Arrays Quiz

Java Arrays Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Python

Python

9th - 12th Grade

20 Qs

Quiz de Programação em C

Quiz de Programação em C

9th - 12th Grade

10 Qs

Examen primera unidad  Progra 5to Baco/PC

Examen primera unidad Progra 5to Baco/PC

12th Grade

16 Qs

Arrays in CQuiz

Arrays in CQuiz

1st Grade - University

10 Qs

Mastering C: Control Structures and More

Mastering C: Control Structures and More

12th Grade

20 Qs

Skill #2 Array

Skill #2 Array

12th Grade

12 Qs

3F_14042025_Verifica per orale Informatica

3F_14042025_Verifica per orale Informatica

11th Grade - University

10 Qs

PBO Kelas XI | Mengenal Tipe Data pada Java

PBO Kelas XI | Mengenal Tipe Data pada Java

12th Grade

15 Qs

Java Arrays Quiz

Java Arrays Quiz

Assessment

Quiz

Information Technology (IT)

12th Grade

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?