About 8,810,000 results
Open links in new tab
  1. Boxing (computer programming) - Wikipedia

    In computer science, boxing (a.k.a. wrapping) is the transformation of placing a primitive type within an object so that the value can be used as a reference. Unboxing is the reverse transformation of extracting the primitive value from its wrapper object.

  2. What is boxing and unboxing and what are the trade offs?

    Nov 27, 2009 · Boxing and unboxing facilitates value types to be treated as objects. Boxing means converting a value to an instance of the object reference type. For example, Int is a class and int is a data type. Converting int to Int is an exemplification of boxing, whereas converting Int to int is unboxing. The concept helps in garbage collection, Unboxing ...

  3. Boxing and Unboxing - C# | Microsoft Learn

    Sep 15, 2021 · Boxing is an implicit conversion of a value type to the type object or to any interface type implemented by this value type. Boxing a value type allocates an object instance on the heap and copies the value into the new object.

  4. What does it mean to say a type is "boxed"? - Stack Overflow

    A boxed type means that the values are allocated in a block on the heap and referenced through a pointer. This is good for uniformity in the implementation of the runtime (it makes it easier to have generic functions, etc), at the cost of an additional indirection.

  5. Why do we need boxing and unboxing in C#? - Stack Overflow

    Unboxing copies the fields from an instance of the class type to an instance of the value type. All of the class types which are created from value types are derived from the ironically named class ValueType (which, despite its name, is actually a reference type).

  6. C# Boxing And Unboxing - GeeksforGeeks

    Mar 17, 2025 · The process of converting a Value Type variable (char, int etc.) to a Reference Type variable (object) is called Boxing. Boxing is an implicit conversion process where a value type is wrapped inside an object instance and stored on the heap.

  7. Boxing and Unboxing | Baeldung on Computer Science

    Jun 17, 2023 · In this article, we studied boxing and unboxing data in the realm of computer programming. Boxing is the process of converting a primitive datatype into an object wrapper datatype, and unboxing is the process of converting a value from an object wrapper type back to the native primitive value. Further on, we can say that both boxing and ...

  8. Boxing and Unboxing in C# with Examples - Dot Net Tutorials

    Jul 3, 2022 · Boxing: Boxing is the process of converting a value type (like int, double, struct) to a reference type (object). When a value type is boxed, a new object is allocated to the heap, and the value is copied into it.

  9. Programming Shootout - Objects vs Boxes vs Actors vs Agents

    Feb 3, 2014 · This post compares four programming models: objects, boxes, actors and agents, by implementing a simple specification with a calculator unit and a client unit. Objected oriented programming with C++ and functional objects in Haskell are the simplest and shortest implementations.

  10. Boxing and Unboxing in C# - Medium

    Mar 10, 2024 · Boxing refers to the process of converting a value type (such as int, char, bool, or double) into a reference type. In languages like C# and Java, this is essential when dealing with...

Refresh