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 / harish
Compilation fails because of an error on
| Is This Answer Correct ? | 5 Yes | 12 No |
Post New Answer View All Answers
Can we sort a map in java?
What is generic type?
Can we use catch statement for checked exceptions?
Java is pass by value or pass by reference? Explain
What is the difference between path and classpath variables?
Why are variables important in research?
Is hashset ordered java?
How to store image in arraylist in java?
What is the finalize method do?
Does string isempty check for null?
Variable of the boolean type is automatically initialized as?
What about interrupt() method of thread class ?
What is the use of put method?
Can each java object keep track of all the threads that want to exclusively access it?
What is the use of using enum to declare a constant?