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
How will you compute size of a structure?
Why destructor is not used in java?
What is hashtable and explain features of hashtable?
What are the benefits of immutable objects?
How do you print array in java?
Can memory leak in java?
How to change value in arraylist java?
What is the declaration statement?
What are the advantages of java inner classes?
What is a boolean structure?
How to invoke external process in java.
Is java jre still free?
is it possible to instantiate the math class?
What is update method called?
What is variable and its types?