Search Header Logo
Unit 6 Test Review - Arrays

Unit 6 Test Review - Arrays

Assessment

Flashcard

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

20 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following is FALSE about arrays on Java: A java array is always an object; Arrays in Java are always initialized to have values of 0; Length of array can be changed after creation of array

Back

Length of array can be changed after creation of array

2.

FLASHCARD QUESTION

Front

Find the output
class Test {
public static void main(String args[]) {
int arr[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}

Back

Compile error

3.

FLASHCARD QUESTION

Front

Find the output
class Test {
public static void main(String args[]) {
int [] arr = new int[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}

Back

0
0

4.

FLASHCARD QUESTION

Front

What is the length of the following array: int [] data = { 12, 34, 9, 0, -62, 88 };

Back

6

5.

FLASHCARD QUESTION

Front

What will happen when executing the following code?
class Demo1 { public static void main(String args[]) { int [] i = new int[10]; System.out.println(i[10]); } }

Back

Out-of-bounds exception

6.

FLASHCARD QUESTION

Front

_________________ is a collection of elements used to store the same type of data.

Back

Array

7.

FLASHCARD QUESTION

Front

What are the legal indexes for the array ar, given the following declaration:

int[] ar = {2, 4, 6, 8 }
?

Back

0, 1, 2, 3

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?