
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.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
DEBUG THE CODE

Quiz
•
University
13 questions
BTEC Level 3 - Unit 1 - Topic 5 (Validating Data)

Quiz
•
12th Grade
10 questions
Programming with C++

Quiz
•
9th - 12th Grade
10 questions
Python-Code Right or Wrong

Quiz
•
7th - 8th Grade
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
15 questions
Java Bootcamp Day 4

Quiz
•
University
15 questions
C programming

Quiz
•
University
12 questions
Computer Systems - How the web works - Lesson 7

Quiz
•
8th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Science
20 questions
States of Matter

Quiz
•
5th Grade
20 questions
Scientific method and variables

Quiz
•
8th Grade
22 questions
Scientific Method and Variables

Quiz
•
8th Grade
20 questions
Chemical and Physical Changes

Quiz
•
7th Grade
20 questions
Physical and Chemical Changes

Quiz
•
8th Grade
20 questions
Scientific Method

Quiz
•
7th Grade
20 questions
Properties of Matter

Quiz
•
5th Grade
10 questions
Scientific Method and Variables

Quiz
•
6th Grade