C # highlights link types and value types.
A reference type is declared using the word class . Variables of these types contain references, so the array will be an array of references to objects. Each reference is 4 bytes (on a 32-bit system) or 8 bytes (on a 64-bit system).
The value type is declared using the word struct . Values ββof this type are copied every time you assign them. An array of type values ββcontains copies of the values, so the size of the array is equal to the size of the structure times the number of elements.
Usually, when we say βobjectβ, we refer to instances of the reference type, so the answer to your question is βyesβ, but remember the difference and make sure that you do not accidentally create a large array of large structure.
source share