what is auto boxing

Answers were Sorted based on User's Feedback



what is auto boxing..

Answer / vijay, hangar17

Auto boxing is introduced in jdk1.5
Automatic conversion from int to Integer is Auto boxing and
automatic conversion back from Integer to int is auto unboxing.

For example

int i;
Integer a

//Manual conversion

i = a.intValue();
a = new Integer(i);

By Auto boxing

i=a;
a=i;

Is This Answer Correct ?    43 Yes 2 No

what is auto boxing..

Answer / narayanarao

Automatic conversion from int to Integer is Auto boxing and
automatic conversion back from Integer to int is auto unboxing.

For example

int i;
Integer a

//Manual conversion

i = a.intValue();
a = new Integer(i);

By Auto boxing

i=a;
a=i;

Is This Answer Correct ?    10 Yes 4 No

what is auto boxing..

Answer / uttam

the above one is correct

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

Who is founder of java?

0 Answers  


What is hashmap in java?

0 Answers  


What is the difference between Java Bean and Java Class.?

2 Answers  


How to create two different thread class inside a main function?

1 Answers  


Explain polymorphism citing an example.

0 Answers   Amazon,






How do you initialize an arraylist in java?

0 Answers  


What is java virtual machine and how it is considered in context of java’s platform independent feature?

0 Answers  


what is generics in jdk1.5?

2 Answers   Bally Technologies,


How do you make a thread in java?

0 Answers  


what is platform independence in java?

5 Answers   CSC, HSBC,


How do you call a reference in java?

0 Answers  


What is finalize()?

0 Answers  


Categories