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

In the line 12 .jus think new Integer(1) will result 1 and
new Integer(2) will result 2 so 1+2=3 which is stored in a i.

so the line 12 can b written as a Integer i=1+3;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is files manifesting?

2157


How do generics work?

906


What is listnode in java?

954


What is this keyword in java?

1001


Explain where variables are created in memory?

979


In case of inheritance what is the execution order of constructor and destructor?

1078


Can you explain the cs option of java interpreter?

910


What are methods and how are they defined?

1163


Can a private method be declared as static?

981


What are the 6 mandatory procedures for iso 9001?

971


Can a class be protected in java?

928


What string is utf8?

938


How garbage collection is done in java?

1008


What are the common uses of "this" keyword in java ?

984


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1135