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 / venkata krishna
Hi,
Answer is 1 means three..
line 12 is executing sucuessfully ,after that i is 3 now
line 13 is switch also executed successfully and print the
three
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is the function of java?
Write code to implement bubble sort in java?
What is a text string?
What is the mapping mechanism used by java to identify IDL language?
Difference between linkedlist and arraylist.
What is the size of arraylist in java?
Can one thread block the other thread?
How many types of string data types are there?
State the main difference between c++ and java?
What is meant by class and object in java?
Why is logger singleton?
What is the meaning of 3 dots in java?
What is a java object and java application?
What are data types in programming?
How does list work in java?