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


Please Help Members By Posting Answers For Below Questions

Why are the destructors for base class and derived class called in reverse order when the program exits

1708


Whats the difference between notify() and notifyall()?

572


Is main is a keyword?

581


What is the exact difference in between unicast and multicast object? Where we will use?

558


What is meant by design patterns?

587






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.

1575


What are the drawbacks of reflection?

565


What is static in java?

559


Why hashcode is used in java?

500


How does compareto work in java?

579


Is there any limitation of using inheritance?

571


Is arraylist dynamic in java?

521


What is the purpose of the file class in java programming?

532


What are predicates in java 8?

532


What happens when a thread cannot acquire a lock on an object in java programming?

549