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 are the destructors for base class and derived class called in reverse order when the program exits
Whats the difference between notify() and notifyall()?
Is main is a keyword?
What is the exact difference in between unicast and multicast object? Where we will use?
What is meant by design patterns?
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.
What are the drawbacks of reflection?
What is static in java?
Why hashcode is used in java?
How does compareto work in java?
Is there any limitation of using inheritance?
Is arraylist dynamic in java?
What is the purpose of the file class in java programming?
What are predicates in java 8?
What happens when a thread cannot acquire a lock on an object in java programming?