C#: Are nullable types (int?) objects? -


I understand that there are no objects in type C of the value, that is, they do not get from the system. Object.

Assuming this logic puts my logic at this point, like int?, Are things that they inherit from the object?

If so, do they subject all rules and constraints to other things, or do they have special rules governing their behavior?

Just as a reference, this question comes from the investigation of the functioning of the null cooperative operator.

wrong - value types are objects, but they are not identical to the reference types Behave - instead of pass-by-reference they are pass-by-value, Nullable & lt; T & gt; (which is T? ) is a straightforward, and therefore comes from System.ValueType and System.Object. In the C # compiler, there is a magic that makes it difficult, in the same way, it behaves according to meaningless relationships as a reference type, but they always keep per-value criteria.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -