Given:
11. public static void main(String[] args) {
12. Integer i = uew Integer(1) + new Integer(2);
13. switch(i) {
14. case 3: System.out.println(”three”); break;
15. default: System.out.println(”other”); break;
16. }
17. }
‘What is the result?
1 three
2 other
3 An exception is thrown at runtime.
4 Compilation fails because of an error on
line 12.
Answer Posted / venkata krishna
Hi,
Answer is 1 means three..
line 12 is executing sucuessfully ,after that i is 3 now
line 13 is switch also executed successfully and print the
three
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
Can you start a thread twice in Java?
Explain the access modifiers for a class, method and variables?
Is alive in java?
What is main string [] args?
What is the purpose of sizeof operator?
what is inner class in java?
Is the milky way in a void?
'A class is a template for an object' explain this statement.
Which is easier netbeans or eclipse?
Can private method static?
What is the difference between JDK and JVM?
What is the SimpleTimeZone class?
How to declare an arraylist in java?
What is method overloading in java ?
What is java used for?