
Java Single Array Quiz

Quiz
•
Other
•
University
•
Medium
Mahmoud Bakkar
Used 19+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for declaring an array in Java?
arrayName dataType;
dataType[] arrayName;
arrayName dataType[];
arrayName[] dataType;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you initialize an array in Java?
int[] myArray = new int();
int[] myArray = new int[5];
int[] myArray = new int[];
int[] myArray = new int[0];
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the third element in an array named 'numbers'?
numbers[3]
numbers[2]
numbers[0]
numbers[1]
4.
OPEN ENDED QUESTION
3 mins • 1 pt
What is the result of the following code? int[] numbers = {1, 2, 3, 4, 5}; System.out.println(numbers[2]);
Evaluate responses using AI:
OFF
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you change the value of the second element in an array named 'names' to 'John'?
names[1] = 'John'
names[2] = 'John'
names[1] = 'Jane'
names[0] = 'John'
6.
OPEN ENDED QUESTION
3 mins • 1 pt
What is the output of the following code? int[] numbers = {1, 2, 3, 4, 5}; for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i] + " "); }
Evaluate responses using AI:
OFF
7.
OPEN ENDED QUESTION
3 mins • 1 pt
What is the output of the following code? int[] numbers = {5, 2, 8, 1, 9}; Arrays.sort(numbers); for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i] + " "); }
Evaluate responses using AI:
OFF
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Quiz on Arrays, Inheritance, and Interfaces in Java

Quiz
•
University
10 questions
Bài tập biến mảng

Quiz
•
1st Grade - University
15 questions
Multiple-Choice Quiz on Java Arrays

Quiz
•
University
9 questions
Tipos de Variables

Quiz
•
University
13 questions
Earthquake Measurement Quiz

Quiz
•
12th Grade - University
10 questions
funciones en c++

Quiz
•
University
13 questions
Java Programming Quiz

Quiz
•
University
15 questions
Sorting Quiz

Quiz
•
University - Professi...
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
Discover more resources for Other
20 questions
Disney Characters

Quiz
•
KG
20 questions
Place Value

Quiz
•
KG - 3rd Grade
20 questions
Logos

Quiz
•
KG
11 questions
Seasons

Quiz
•
KG - 1st Grade
10 questions
Who is that Character?

Quiz
•
KG - 5th Grade
15 questions
Short o

Quiz
•
KG - 2nd Grade
15 questions
Pronouns

Quiz
•
KG - 3rd Grade
20 questions
Punctuation Pre & Post Test

Quiz
•
KG - 2nd Grade