I understand that value types like int
or bool
in C# get boxed, like in this example:
int i = 5;
object o = i; // boxing occurs
But do I need to worry about C# boxing string
types as well?
string e = "hello world";
object o = e; // does boxing occur here?
I ask because string
types are reference types with value semantics, so I'm unsure.