Error!
Success!

C# Null – Which types can accept null?

0
kicks

C# Null – Which types can accept null?  (Unpublished)

A few days ago someone asked me which types can accept null and also how could this be determined at runtime. After a quick Google and some chit chat we found that only if the variables type is not a value type or the variables type has a generic type definition of Nullable<> can the variable accept null . This is really helpful to know when you are dynamically invoking methods at runtime and you are not sure if the methods parameters will accept the passed in values.


Kicked By:
Drop Kicked By: