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
What data type is true or false?
Give any two differences between C++ and java.
What do you mean by constructor?
What is oops in java?
What is the += operator called?
How to sort list of list in java?
Is singleton a bad practice?
What is formatted output in java?
what is collatration?
Where is the find and replace?
Can a constructor call another constructor?
What are advantages and disadvantages of OOPs?
What is array pointers ?
Why do we create threads in java?
How can we make string upper case or lower case?