Find the output
class Test {
public static void main(String args[]) {
int arr[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
Arrays in Java
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Jharna Marwah[UHD]
Used 235+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 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
2.
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
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Demo1
{
public static void main(String args[])
{
int i[] = new int[0];
System.out.println(i[0]);
}
}
0
Exception
Garbage value
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Demo1
{
public static void main(String args[])
{
int i[] = new int[10];
System.out.println(i[10]);
}
}
0
Garbage value
Out of bound exception
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How will you identify a single dimensional array?
single curly brackets
single square brackets
multiple squares brackets
single angled brackets
6.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
If the data is in order the best search to use would be a______
Binary Search
Linear Search
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is returned by values[5]?
2
12
6
8
20 questions
Array
Quiz
•
10th - 12th Grade
20 questions
DATA STRUCTURES
Quiz
•
12th Grade
15 questions
Java Variables, Input and Output
Quiz
•
10th - 12th Grade
20 questions
Computer Application Practice Quiz Class 10
Quiz
•
10th Grade
19 questions
Unit 5 - Two-Dimensional Arrays
Quiz
•
9th - 12th Grade
22 questions
Java Code Snippets Quiz 1
Quiz
•
10th Grade
20 questions
looping and branching statements in C
Quiz
•
9th Grade
20 questions
Fase F - Array
Quiz
•
11th Grade
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
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