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 / james n saikay
Three
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How many times finalize method will be invoked? Who invokes finalize() method in java?
Give any two differences between C++ and java.
What is preflight request?
What are register variables what are the advantages?
Is java call by reference?
What is hashset in java?
What is the difference between yield() and sleep()?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
How to perform bubble sort in java?
What is default switch case? Give example.
How do you call a reference in java?
What exactly is a .class file?
I want to print “hello” even before main is executed. How will you acheive that?
What are the basics of core java?
What do you understand by java virtual machine?