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 / harish

Compilation fails because of an error on

Is This Answer Correct ?    5 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain the usages of class.forname()?

609


What is connection class in java?

508


What is a conditional equation?

562


State one difference between a template class and class template.

625


Why object class is super class for every class in java?

574






What is numeric function?

542


What is difference between fileinputstream and filereader in java?

560


Implement two stacks using a single array.

573


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

555


Write a function to find out longest palindrome in a given string?

594


What is method overloading in JAVA? Why is it not present in C ?

592


How does callback work in java?

607


What are different types of states exist for a thread?

551


What are access specifiers in java ?

590


Which types of exceptions are caught at compile time?

566