APCS A - Array 6.1,6.2,6.3,6.

APCS A - Array 6.1,6.2,6.3,6.

Assessment

Flashcard

Computers

9th - 12th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

30 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the correct way to declare an array in Java? Options: int arr[] = new int[5];, int arr() = new int[5];, int arr = new int[5];, array int arr = new int[5];, int[5] arr;

Back

int arr[] = new int[5];

2.

FLASHCARD QUESTION

Front

What is the default value of an int array element in Java?

Back

0

3.

FLASHCARD QUESTION

Front

How do you get the length of an array arr in Java?

Back

arr.length

4.

FLASHCARD QUESTION

Front

What will arr[arr.length - 1] return?

Back

The last element

5.

FLASHCARD QUESTION

Front

Which exception is thrown for accessing an array index out of bounds? Options: IndexOutOfRangeException, OutOfMemoryError, NullPointerException, ArrayIndexOutOfBoundsException, IllegalArgumentException

Back

ArrayIndexOutOfBoundsException

6.

FLASHCARD QUESTION

Front

What is the index of the first element in an array?

Back

0

7.

FLASHCARD QUESTION

Front

Which of the following creates a 2D array? int arr[][] = new int[2][3];, int arr[] = new int[2,3];, int arr[2][3];, int arr = int[2][3];, int[][] arr = {2,3};

Back

int arr[][] = new int[2][3];

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?