Unit 6 - Arrays Review

Interactive Video
•
Computers
•
11th Grade
•
Medium
Myra Deister
Used 2+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about Java arrays is false?
Arrays can hold primitive data types and objects
The size of an array can be changed after initialization
Multi-dimensional arrays are arrays of arrays
Array elements are stored in contiguous memory locations
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a valid way to declare and initialize an array in Java?
nt[] numbers = new int[5];
int numbers[] = {1, 2, 3, 4, 5};
int[] numbers = new int[]{1, 2, 3, 4, 5};
int numbers[5] = {1, 2, 3, 4, 5};
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code snippet:
int[] arr = new int[5];
arr[5] = 10;
What will happen when this code is executed?
The value 10 will be stored at index 5
An ArrayIndexOutOfBoundsException will be thrown
The array will automatically resize to accommodate the new element
The value 10 will be stored at index 4
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes the relationship between an array's reference variable and its object in memory?
They are stored in the same memory location
The reference variable stores the first element of the array
The reference variable points to the array object on the heap
The reference variable stores the length of the array
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
int[] a = {1, 2, 3, 4, 5};
int[] b = a;
b[2] = 10;
System.out.println(a[2]);
3
10
5
An error occurs
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the example, is it possible to use an enhanced for loop instead of a for loop?
True
False
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code:
int[] arr = {1, 2, 3, 4, 5};
for(int i = 0; i < arr.length; i += 2) {
System.out.print(arr[i] + " ");
}
What will be the output?
1 2 3 4 5
1 3 5
2 4
1 3
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
The Art of Doing - Web Development for Beginners - JavaScript Data Types

Interactive video
•
University
11 questions
Bash Shell Scripting- Introduction to Arrays

Interactive video
•
University
11 questions
Data Science and Machine Learning (Theory and Projects) A to Z - NumPy for Numerical Data Processing: Arrange, Random, a

Interactive video
•
University
11 questions
Complete Java SE 8 Developer Bootcamp - Arrays

Interactive video
•
University
11 questions
Java ☕ Arrays and Array Lists

Interactive video
•
12th Grade - University
8 questions
JavaScript Mastery from Zero to Hero - Prepare for Coding Interviews - Adding to Arrays with Splice in JavaScript

Interactive video
•
9th - 10th Grade
8 questions
REST API Automation Testing from Scratch - REST Assured Java - Introduction to Arrays

Interactive video
•
University
11 questions
Full Stack Web Development MASTERY Course - Novice to Expert - Conversion and Coercion

Interactive video
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade