can we assign null value to value type in c#?
Answer Posted / aditya
Nullable type is introduced in .NET 2.0. Before 2.0 it was
not possible to assign null to value types.
This was possible with the introduction of Generics in 2.0
and the it would be something like this...
System.Nullable<int> x = new System.Nullable<int>;
or
int? salary = null (new type modifier in 2.0)
| Is This Answer Correct ? | 30 Yes | 7 No |
Post New Answer View All Answers
How do you set a class path?
What are partial types in c#?
Is concurrent queue thread safe?
What is difference between singleordefault and firstordefault?
What is a console application in c#?
Which is faster abstract class or interface in c#?
what are some characteristics of an array?
What is web forms in c#?
Is php better than c#?
What is singleordefault?
What is the difference between dynamic and var in c#?
Can you instantiate an abstract class c#?
What is the major difference between a custom control and user control?
What are get and set in c#?
Which are the access modifiers available in c#?