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
Can a constructor have different name than a class name in java?
Explain about static imports in java?
What is variable and example?
What is java abstraction with example?
What are the different types of methodologies?
What is the program development process?
what is encapsulation in java? Explain
What is difference between next () and nextline () in java?
Is null an object java?
What is a hashmap used for?
How big is a pointer?
Why multiple inheritance is not supported by java?
What are reference variables in java?
How many digits can a float hold?
What is hasnext in java?