Given the following code for the classes MyException and Test: What is the result?
A.
A
B.
B
C.
Either A or B
D.
A B
E.
A compile time error occurs at line n1
Given the following code for the classes MyException and Test: What is the result?
A.
A
B.
B
C.
Either A or B
D.
A B
E.
A compile time error occurs at line n1
B seems correct
Yeap B is correct (most of the answers in this dump are incorrect)
You’re wrong. A few questions on this dump might be incorrect, but the vast and enormously large portion of the answers are indeed correct. I’ve verified them with Pass4Sure and 2 other dumps.
Can you please mail the dumps to my mail id, [email protected]
Hi Bob,
Can you please send dumps to my email [email protected]
test
Could you please send me the dumps [email protected]
Hi Bob,
also may you please send me those dumps please. [email protected]. thank you
Hi Bob,
Please send me dump of Pass4Sure on [email protected]
i’m going to write an exam 1z0-808.
Best Regards,
Pooja
Answer is B
Definitely B.
Both are RuntimeExceptions.
Assume class MyException and class Test are at 2 different java files.
Cannot have 2 public class at one same java file.
Answer: B
Tested
b
Well, sometimes it prints B
package Exceptions;
public class MyException extends RuntimeException {
}
package Exceptions;
public class Test {
public static void main(String[] args) {
try {
method1();
} catch (MyException ne) {
System.out.println(“A”);
}
}
public static void method1() {
try {
throw Math.random() > 0.5 ? new MyException() : new RuntimeException();
} catch (MyException re) {
System.out.println(“B”);
}
}
}
Console:
B
And sometimes i get RuntimeException when the random number is above 0.5
Console:
Exception in thread “main” java.lang.RuntimeException
at Exceptions.Test.method1(Test.java:15)
at Exceptions.Test.main(Test.java:7)
Correction:
(option 1)catch (MyException re) => (option 2)catch (RuntimeException re)