Which of the following is FALSE about arrays on Java
Java Array Basics

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Thomas Martinez
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
A java array is always an object
Length of array can be changed after creation of array
Arrays in Java are always allocated on heap
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
5 mins • 1 pt
What is the length of the following array: byte[] 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 Quizizz
20 questions
APCS A - Array 6.1,6.2,6.3,6.

Quiz
•
9th - 12th Grade
20 questions
Fase F - Array

Quiz
•
11th Grade
19 questions
Unit 9 CSA

Quiz
•
11th Grade
20 questions
APCSA Arrays

Quiz
•
9th - 12th Grade
20 questions
Java, part I

Quiz
•
11th Grade - University
15 questions
Area With Arrays

Quiz
•
10th - 12th Grade
15 questions
Area and Arrays

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

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University