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 / nandhakumar
4) ac
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between compile-time polymorphism and runtime polymorphism?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
What is the difference between preparedstatement and statement in java?
What is a singleton class? Give a practical example of its usage.
Difference between current previous versions of Java?
I want to persist data of objects for later use. What is the best approach to do so?
I want to print “hello” even before main is executed. How will you acheive that?
What is the platform?
What is purpose of keyword void?
What is factor r?
What is the difference between jdk, jre, and jvm?
What is blank final variable?
What does java final mean?
How do you sort arrays in java?
What is a condition in programming?