APCSA Arrays

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Jennifer Hoagland
Used 115+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is FALSE about arrays on Java
A java array is always an object
Length of array can be changed after creation of array
Arrays in Java are always initialized to have values of 0
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Find the output
class Test {
public static void main(String args[]) {
int arr[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
Compile error
Exception
Garbage Value
Garbage Value
0
0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output
class Test {
public static void main(String args[]) {
int [ ] arr = new int[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
Compile error
Exception
Garbage Value
Garbage Value
0
0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output of following Java program?
class Test{
public static void main (String[] args) {
int [] arr1 = {1, 2, 3};
int [] arr2 = {1, 2, 3};
if (arr1 == arr2)
System.out.println("Same");
else
System.out.println("Not same");
}}
Same
Not same
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Test{
public static void main (String[] args) {
int [] arr1= {1, 2, 3};
int [] arr2 = {1, 2, 3};
if(arr1.equals(arr2))
System.out.println("Same");
else
System.out.println("Not same");
}}
Same
Not same
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the length of the following array: int [] data = { 12, 34, 9, 0, -62, 88 };
1
5
6
12
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Does a programmer always know how long an array will be when the program is being written?
Yes---the program will not compile without the length being declared.
No---the array object is created when the program is running, and the length might change from run to run.
Yes---otherwise the program will not run correctly.
No---arrays can grow to whatever length is needed.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
JAVA: Level-1

Quiz
•
5th - 12th Grade
20 questions
JAVA FUNDAMENTALS

Quiz
•
9th - 12th Grade
15 questions
Java Level 1 - C

Quiz
•
12th Grade
20 questions
Computer Application Practice Quiz Class 10

Quiz
•
10th Grade
16 questions
Java Основи

Quiz
•
11th Grade - University
20 questions
terstruktur

Quiz
•
10th Grade
15 questions
Soal Java

Quiz
•
11th Grade - University
20 questions
Arrays in Java

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
24 questions
Scientific method and variables review

Quiz
•
9th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
19 questions
Mental Health Vocabulary Pre-test

Quiz
•
9th Grade