33. try {
34. // some code here
35. } catch (NullPointerException e1) {
36. System.out.print(”a”);
37. } catch (RuntimeException e2) {
38. System.out.print(”b”);
39. } finally {
40. System.out.print(”c”);
41. }
What is the result if a NullPointerException occurs on line
34?
1 c
2 a
3 ab
4 ac
Answer Posted / kumar
Once the first catch block executed then rest of the block
skipped.The control transfer to the finally block
the answer is "ac"
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the range of a character variable?
Have you ever used hashtable and dictionary?
Is string serializable in java?
what happens when a thread cannot acquire a lock on an object? : Java thread
What is the purpose of format function?
How a string is stored in memory?
How do you use substring in java?
What is the latest version of java?
Can we declare a class as abstract without having any abstract method?
What is finally and finalize in java?
Does java have extension methods?
What is the purpose of void?
Which one of the following suits the description of a string better: derived or primitive?
What are the two environment variables that must be set in order to run any java programs?
Explain the features of interfaces in java?