ExamVeda
Login
Home
11
In Java, which type of exceptions are checked at compile-time?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
12
What is the result of the following code snippet?

try {
int num = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception!");
} catch (Exception e) {
System.out.println("Exception!");
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
13
In Java, which type of exceptions are unchecked at compile-time?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
What is the result of the following code snippet?

try {
String str = null;
System.out.println(str.length());
} catch (NullPointerException e) {
System.out.println("NullPointerException!");
} catch (Exception e) {
System.out.println("Exception!");
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
15
In Java, can a "finally" block be used without a "try-catch" block?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
16
What is the purpose of the "finally" block in Java exception handling?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
17
In Java, can a "finally" block be used without a "catch" block?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
18
What is the result of the following code snippet?

try {
int[] arr = new int[5];
int value = arr[2];
} catch (NullPointerException e) {
System.out.println("NullPointerException!");
} finally {
System.out.println("Finally Block!");
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
19
In Java, can a "catch" block catch exceptions of a superclass type?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
20
What is the result of the following code snippet?

try {
int result = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception!");
} finally {
System.out.println("Finally Block!");
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board