- int i=0; double j =i;
- int i=1; string j =i.ToString();
Interviews5 answers
Which one will be call boxing in the given situation?
5 Answers
2 because boxing convert value type to object type
Digambar BhandarePosted Jan 28, 2023, 2:16 AM EST
int a = 1;
Object o = a; //Boxing Convert Value type to Ref Type
Naeem KhanPosted Nov 27, 2022, 5:20 AM EST
when we convert value type to object type
Amol KakdePosted Nov 17, 2022, 5:41 AM EST
Primitive type is called as boxing
Here int i=0 is boxing
When you do typecasting then it's called as unboxing
Int i = xyz.tosting()
Aravind GovindarajPosted Nov 16, 2022, 6:10 PM EST
Hi Rajan Mishra,
2 one will be call boxing in the given situation
int i=1; string j =i.ToString();
For more details:
Boxing and Unboxing in C#
https://www.tutorialsteacher.com/articles/boxing-unboxing-in-csharp
Hope, this will help you!
Pankajkumar PatelPosted Nov 15, 2022, 4:58 AM EST



