Java Quiz 3 - Array

Quiz
•
Computers
•
University
•
Hard
Vijayaraman P
Used 69+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Array is
immutable
mutable
always contant
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following declares an array of int named img?
int img;
int[] img;
new int img[];
int img = int[];
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the legal indexes for the array ar, given the following declaration:
int[] ar = {2, 4, 6, 8 };
0, 1, 2, 3
1, 2, 3, 4
2, 4, 6, 8
0, 2, 4. 6
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment:
int[] ar = {2, 4, 6, 8 };
System.out.println( ar[0] + " " + ar[1] );
2 6
8
2 4
6 8
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment:
int[] ar = {2, 4, 6, 8 };
ar[0] = 23;
ar[3] = ar[1];
System.out.println( ar[0] + " " + ar[3] );
23 2
2 8
31
23 4
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment:
int[] y = new int[5];
y[0] = 34;
y[1] = 88;
System.out.println( y[0] + " " + y[1] + " " + y[5] );
34 88 0
34 88 88
The program is defective and will not compile
0 34 88
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment:
int[] z = new int[9];
z[0] = 7;
z[1] = 3;
z[2] = 4;
System.out.println( z[0] + z[1] + " " + z[5] );
10 0
7 3 0
The program is defective and will not compile.
7 3 4
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
Java Programming Structures

Quiz
•
University
6 questions
Quiz on methods

Quiz
•
University
15 questions
OOP1 Quiz 2

Quiz
•
University
10 questions
Java Program

Quiz
•
University
15 questions
OOPS concepts

Quiz
•
University
10 questions
Java Static

Quiz
•
University
10 questions
Inheritance

Quiz
•
University
10 questions
java operators

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