R
Q. What will be the output? class MyClass{ public String test(){ try{ System.out.print("One"); return ""; } finally{ System.out.print("Two"); } } } public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); m.test(); } }
Finally block will execute irrespective of return statement in try block.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. What is the output of a Bitwise OR (|) operation if one of the inputs/operands is 1?
Q. What is the value of the expression 5 + 2 == 7 && 4 > 3 in Java?
Q. What is method overriding in Java?
Q. Select from among the following character escape code which is not available in Java.
Q. Which of these is not a correct statement?.
Q. Which of these packages contain all the Java’s built in exceptions?
Q. What is the output of the following Java Code?
Q. What is the process of defining a method in terms of itself that is a method that calls itself?
Discusssion
Login to discuss.