What does boxing mean?

Discussion in 'C#' started by Clydebrown, Jan 2, 2013.

  1. Clydebrown

    Clydebrown New Member

    Joined:
    Aug 23, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I want to know about boxing, what does boxing mean?
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
  3. Charlesdawson

    Charlesdawson New Member

    Joined:
    Apr 11, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    It is the process of switching a value type to the type object or to any interface type executed by this value type.

    For example,

    int i = 789;
    // following line boxes i.
    object obj = i;
     
  4. Ami Desai

    Ami Desai Member

    Joined:
    Jan 5, 2017
    Messages:
    42
    Likes Received:
    17
    Trophy Points:
    8
    Location:
    Ahmedabad
    Home Page:
    http://www.ifourtechnolab.com/
    Hi,

    When a value type is converted to object type, it is called boxing

    object obj;
    obj = 100; // this is boxing

    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice