
Java Debugging Questions - H

Quiz
•
Other
•
University
•
Hard
kcedhruva_cybersecurity codedebugging
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the error in the following code?
int x = 10;
System.out.println(X);
X should be lowercase
Missing semicolon
Print statement syntax is incorrect
No error
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will happen when compiling this code?
final int x;
x = 10;
No error
Variable x cannot be reassigned
x must be initialized
x is not accessible
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Find the error in this snippet:
for(int i = 0; i < 5; i--){
System.out.println(i);
}
Infinite loop
Incorrect loop condition
i should be incremented
No error
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will this print?
System.out.println(10 / 0);
0
Infinity
Compilation error
ArithmeticException
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which error occurs in this code?
String s = null;
s.length();
NullPointerException
RuntimeException
Compilation error
No error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Identify the issue: int arr[] = new int[-5];
Compilation error
RuntimeException
No error
ArrayIndexOutOfBoundsException
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the problem here?
class Test {
void show() {
System.out.println('Hello');
}
}
Missing main method
Syntax error in print statement
Class should be public
No error
Create a free account and access millions of resources
Similar Resources on Wayground
24 questions
Java MCQs on Threads and Exceptions

Quiz
•
University
16 questions
oops

Quiz
•
University
15 questions
Technoquiz..3

Quiz
•
University
15 questions
C programming and Arduino Basics

Quiz
•
University
20 questions
Round 2

Quiz
•
University
15 questions
Java Debugging Questions - M

Quiz
•
University
20 questions
Java Programming Quiz for swapna

Quiz
•
University
20 questions
Round 1

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade