
Arrays
Authored by sudha reddy
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
quiz pertemuan 2 asik ddp
Quiz
•
University
15 questions
Computer Science Quiz
Quiz
•
University
10 questions
Sistema Binario
Quiz
•
1st Grade - University
10 questions
Modelo Cliente/Servidor
Quiz
•
University
10 questions
Node.js
Quiz
•
University
10 questions
6ta generación de computadoras
Quiz
•
University
10 questions
Java Control Flow statements
Quiz
•
University
10 questions
C++ Array Quiz
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University