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.

Answers were Sorted based on User's Feedback



Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / amit mittal

Three will be the answer.

Is This Answer Correct ?    27 Yes 3 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / venkata krishna

Hi,

Answer is 1 means three..

line 12 is executing sucuessfully ,after that i is 3 now
line 13 is switch also executed successfully and print the
three

Is This Answer Correct ?    8 Yes 2 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / 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+2;

the answer is 1) three

Is This Answer Correct ?    5 Yes 1 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

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

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / kumar

The above scenario using Wrapper class.The Wrapper class
allows arthmetic opertion(Boxing and unboxing the interget
numbers).So the result will be "three"

Is This Answer Correct ?    1 Yes 0 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / balamurugan

Three is answer.

Is This Answer Correct ?    2 Yes 2 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / james n saikay

Three

Is This Answer Correct ?    0 Yes 0 No

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

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

Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2..

Answer / harish

Compilation fails because of an error on

Is This Answer Correct ?    5 Yes 12 No

Post New Answer

More Core Java Interview Questions

Is list ordered in java?

0 Answers  


What is the use of StringTokenizer class?

0 Answers   Hexaware, Virtusa,


Why declare Main() method as a static in java ?

0 Answers   HCL,


How to access a variable if it is declared as private?

3 Answers  


List the interfaces which extends collection interface?

0 Answers  


What is quick sort in java?

0 Answers  


How to convert string to char and vice versa?

0 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


What is a line break example?

0 Answers  


What is nested top-level class?

0 Answers  


What is meant by singleton class?

0 Answers  


Difference between string s= new string (); and string s = "abv";?

0 Answers   Cap Gemini,


Categories