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 synchronization and why is it important in java programming?
How do you do exponents in java?
Are arrays primitive data types?
What is a type parameter in java?
How concurrent hashmap works?
Tell us something about set interface.
Explain garbage collection in java?
What is the difference between yielding and sleeping?
What are the main uses of java?
What is int argc char * argv?
Is minecraft 1.15 out?
What is set string?
What is java virtual machine? Explain
What things should be kept in mind while creating your own exceptions in java?
When should I use a singleton?