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 / nirmal
Ans 4: Compilation fails because of an error on
line 12.
Reason: The operator + is undefined for the argument type
(s) java.lang.Integer, java.lang.Integer Cannot switch on a
value of type Integer. Only int values or enum constants
are permitted.
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
What is anagram in java?
List some important characteristics on jre
State the merge-sort principle and its time complexity.
Explain about sets?
What is the latest version of java?
What is the difference between JVM and JRE?
What is method in java with example?
What is final int?
Explain about narrowing conversion in java?
What access modifiers can be used for variables?
What are the benefits of operations in java?
What is subsequence of a string?
Difference between object instantiation and construction ?
How many types of assembly languages are there?