Given the following snippet code:
try
{
someMethod(arr, val);
}
catch (RuntimeException e)
{
System.out.println("Oopsie");
}
Where it is possible that someMethod can throw either a NullPointerException or an IndexOutOfBoundsException, both of which inherit from RuntimeException, what happens when either of these Exceptions occur?
A- The program will terminate because neither NullPointerException or IndexOutOfBoundsException is caught by the try statement
B- There is no way of knowing
C- It will output "Oopsie"
D- This will not compile
Answer; C- It will output "Oopsie"
You might also like to view...
To insert a picture into a presentation, the picture must be saved in a(n) ____________________ that PowerPoint can recognize.
Fill in the blank(s) with the appropriate word(s).
A distraction is a communication filter
Indicate whether the statement is true or false
A method involving unauthorized user requests between two parties without either party knowing the communication link has been compromised.
A. Spoofing B. Social engineering C. Spam D. Man in the middle
Joe received a digitally signed message from Grace What cryptographic key should he use to verify that digital signature?
a. Grace's public key b. Grace's private key c. Joe's public key d. Joe's private key