Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi. I did read about the System.Object from the Microsoft Docs but I didn't understand one thing. Okay I know that every class in .NET implicitely inherits from System.Object and I know that when I pass a value type to object variable its getting wrapped by the System.Object and is allocated to the managed heap but what happens when I pass to the System.Object a reference type ? Is it going to be re-boxed or ?


Btw also one additional question: How I am able to pass everything i want to object of the System.Object ?

What I have tried:

Reading the Microsoft's Documentation
Posted
Updated 2-Jul-17 10:02am

1 solution

Maybe this article will clear things up: C# 4.0 Tutorial: System.Object - 2016[^]
Quote:
When we cast between a value type and object, the CLR must perform some special work to bridge the difference in semantics between value and reference types. This process is called boxing and unboxing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900