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

What data type is true or false?

584


Give any two differences between C++ and java.

568


What do you mean by constructor?

562


What is oops in java?

581


What is the += operator called?

583






How to sort list of list in java?

673


Is singleton a bad practice?

587


What is formatted output in java?

507


what is collatration?

2751


Where is the find and replace?

542


Can a constructor call another constructor?

569


What are advantages and disadvantages of OOPs?

636


What is array pointers ?

611


Why do we create threads in java?

592


How can we make string upper case or lower case?

608