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 runtime locatable code?
What is the difference between pass by reference and pass by pointer?
What is the main purpose of java?
For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
How many bits is size_t?
What do you know about the garbage collector in java?
what state does a thread enter when it terminates its processing? : Java thread
Write a function for palindrome and factorial and explain?
What is int short for?
When we should use serialization?
What are the differences between checked exception and unchecked exception?
Can we extend immutable class?
What is a dot notation?
What is unicode used for?
What is function and its uses?