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 / amit mittal
Three will be the answer.
| Is This Answer Correct ? | 27 Yes | 3 No |
Post New Answer View All Answers
What is field name?
What is a method header?
How to avoid memory leak in java?
What is the symbol for line break?
Can we override static methods in java?
Explain the importance of finalize() method.
can I implement my own start() method? : Java thread
Explain when classnotfoundexception will be raised ?
What language is an assembler written in?
Is array a class in java?
what is method reference in java 8?
What is the difference between compile-time polymorphism and runtime polymorphism?
What is the benefit of using enum to declare a constant?
What is numeric data type?
How do you create a method in java?