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 boolean strategy?
What do you understand by overloading and overriding in java?
What is stringwriter?
What is the main functionality of the remote reference layer?
What is java util collection?
What is hasnext in java?
Why is the main method declared static?
What is the use of bufferedreader?
What is a control variable example?
What is meant by the value of a variable?
How does compareto work in java?
how to create daemon thread in java?
What is the largest data type in java?
Define inheritance?
What is final variable?