What happens when calling the following method with a non-null and non-empty
array?
OCA Arrays
Quiz
•
Science, Computers
•
KG - University
•
Hard
T K
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What happens when calling the following method with a non-null and non-empty
array?
It adds an element to the array the value of which is Times Square.
It replaces the last element in the array with the value Times Square.
It does not compile.
It throws an exception.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many lines does the following code output?
Six
Seven
The code does not compile.
The code compiles but throws an exception at runtime.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many dimensions does the array reference moreBools allow?
boolean[][][] bools, moreBools;
One dimension
Two dimensions
Three dimensions
None of the above
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is a possible output of the following code?
String[] strings = new String[2];
System.out.println(strings);
[null, null]
[,]
[Ljava.lang.String;@74a14482
None of the above
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the result of running the code as java Copier?
0
0 followed by an exception
1 followed by an exception
The code does not compile.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the result of running the following program?
X
The code does not compile.
The code compiles but throws a NullPointerException at runtime.
The code compiles but throws a different exception at runtime.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following output?
-1
-2
-3
The output is not defined.
12 questions
Java - arrays and String methods
Quiz
•
9th - 12th Grade
10 questions
Arrays
Quiz
•
11th Grade
14 questions
Data Structure
Quiz
•
University
10 questions
Talent Next Java MCQ-1
Quiz
•
University
14 questions
PBO KELAS 12
Quiz
•
12th Grade
10 questions
Arrays
Quiz
•
10th - 12th Grade
10 questions
BCSC0006 - Quiz 1 - Arrays
Quiz
•
University
14 questions
Exploring Computer Science
Quiz
•
10th - 12th Grade
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
12 questions
Multiplying Fractions
Quiz
•
6th Grade
30 questions
Biology Regents Review #1
Quiz
•
9th Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function
Quiz
•
9th - 12th Grade
30 questions
Biology Regents Review #1
Quiz
•
9th Grade
50 questions
Biology Regents Review: Structure & Function
Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review 2: Ecology
Quiz
•
9th - 12th Grade
20 questions
Soil and Erosion Review
Quiz
•
3rd Grade
20 questions
MCAS Biology Review
Quiz
•
9th - 10th Grade
19 questions
VA Natural Resources / Watershed
Quiz
•
4th Grade
85 questions
Regents Living Environment
Quiz
•
8th - 11th Grade
30 questions
Science EOG Review
Quiz
•
5th Grade