Rajan Mishra
Which one will be call boxing in the given situation?
  1. int i=0; double j =i;
  2. int i=1; string j =i.ToString();
By Rajan Mishra in .NET on Oct 30 2022
  • Pankaj Patel
    Nov, 2022 15

    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!

    • 2
  • Digambar Bhandare
    Jan, 2023 28

    2 because boxing convert value type to object type

    • 0
  • Naeem Khan
    Nov, 2022 27

    int a = 1; Object o = a; //Boxing Convert Value type to Ref Type

    • 0
  • Amol Kakde
    Nov, 2022 17

    when we convert value type to object type

    • 0
  • Aravind  Govindaraj
    Nov, 2022 16

    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()

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS