Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can you explain inner class.

1020


Can a class be private or protected in java?

999


Why Java is not pure Object Oriented language?

1059


What are design patterns and please explain?

1032


What do you mean by flow of struts?

1224


Write a program to print the pattern given below

886


What are java annotations?

1068


What is the difference between object oriented programming language and object based programming language?

944


What is the default size of set in java?

903


What is use of functional interface in java 8? Explain

944


what is method reference in java 8?

977


Define nashorn in java8.

971


Explain about main() method in java ?

998


What is floor in java?

989


What is the use of default method in interface in java?

964