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 / james n saikay

Three

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is use of functional interface in java 8?

561


When does a class need a virtual destructor?

530


Are generics important java?

524


What is a line break?

586


What is currentthread()?

575






Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

556


What is indexof?

545


Difference between association, composition and aggregation?

561


What is formatted output in java?

499


What is string manipulation?

497


What is the purpose of garbage collection in java?

653


Give an example of use of pointers in java class.

563


What is meant by class loader? How many types are there?

676


What is the difference between method and means?

572


What should I import for arraylist in java?

510