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 / amit mittal
Three will be the answer.
| Is This Answer Correct ? | 27 Yes | 3 No |
Post New Answer View All Answers
Why singleton is not thread safe?
How many bytes is a string in java?
What is type parameter in java?
What is void in java?
What is super keyword explain with example?
What is the difference between class & structure?
How do you define a set in java?
Is void a return type?
What is the difference between compiler and jvm?
What is empty string literal in java?
What are the six ways to use this keyword?
What is substring in java?
How can u increase the heap size in the memory?
Describe different states of a thread.
Can interface be private in java?