Java Debugging Questions - H

Java Debugging Questions - H

University

20 Qs

quiz-placeholder

Similar activities

ambot para asa ni

ambot para asa ni

University

20 Qs

Java programming

Java programming

University

20 Qs

Engineers Day Celebration Quiz - Code IT, STME HYD

Engineers Day Celebration Quiz - Code IT, STME HYD

University

15 Qs

TECHTRIX2025 BUGHUNT SET4

TECHTRIX2025 BUGHUNT SET4

University

20 Qs

JAVA-LAB-VIVA-2

JAVA-LAB-VIVA-2

University

15 Qs

Java Debugging Questions - M

Java Debugging Questions - M

University

15 Qs

Intro to  Java

Intro to Java

University

15 Qs

Javapie Quiz

Javapie Quiz

University

20 Qs

Java Debugging Questions - H

Java Debugging Questions - H

Assessment

Quiz

Other

University

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?