
Arrays

Quiz
•
Computers
•
University
•
Medium
sudha reddy
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output for the following code fragment?
int [ ] a = new int [5];
a[0] = 5;
a[1] = 4;
a[2] = 3;
System.out.print(a[0] + a[1] + a[4]);
9
5 4 3
5 4 0
8
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What number is in matrix[2][2]?
int [ ] [ ] matrix = { {1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16}
};
6
11
15
10
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment?
int [ ] items = {2, 7, 3, 5, 8, 9};
int funny = items[0];
for (int i = 0; i < items.length; i++)
{
if (items[ i ] > funny)
funny = items[ i ];
}
System.out.print(funny);
1,2,3,4,5,6,7,8,9
7,9
1
9
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment?
int [ ] evens = {2, 4, 6, 8, 10};
evens[0] = 44;
evens[4] = evens[2];
System.out.println(evens[0] + " " + evens[4]);
44 10
2 10
44 6
0 0
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index range for the elements of an array in Java?
0 to length-1
0 to length
-1 to length
1 to length
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these operators is used to allocate memory to array variable in Java?
Malloc
realloc
new
new malloc
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is necessary to specify at time of array initialization?
row
column
both
none
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Java Arrays

Quiz
•
University
12 questions
Arrays C++

Quiz
•
University
12 questions
JavaScript Quiz

Quiz
•
University
15 questions
ARRAYS AND FUNCTIONS

Quiz
•
University
10 questions
DSA(UNIT 1) Test 1

Quiz
•
University
12 questions
Python Quiz 1.6

Quiz
•
University
15 questions
Arrays and Pointers in C

Quiz
•
University
10 questions
cp06-01-1D-Array

Quiz
•
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
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University