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 / kumar
The above scenario using Wrapper class.The Wrapper class
allows arthmetic opertion(Boxing and unboxing the interget
numbers).So the result will be "three"
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is replacefirst in java?
Why java is secure? Explain.
What is method in research paper?
What are the major advantages of internal iteration over external iteration?
What are multiple inheritances? Is it supported by java?
What is the difference between sop and work instruction?
What's the default access specifier for variables and methods of a class?
Difference between this() and super() in java ?
What is final, finally, finalize?
What is function overriding and overloading in java?
What is the point of polymorphism java?
What is internal variable?
What does n mean in java?
Can array grow dynamically in java?
How many types of memory areas are allocated by JVM in java?