object[] objs = new object[]{"one","two","three"};
Are the strings stored in the array as references to the string objects
[@] - one
[@] - two
[@] - three
or are the string objects stored in the array elements?
[one][two][three]
Thanks.
Edit: Sorry, my fancy diagram failed miserably.
String objects can never be stored directly in an array, or as any other variable. It’s always references, even in a simple case such as:
Here the value of
xis a reference, not an object. No expression value is ever an object – it’s always either a reference, a value type value, or a pointer.