What is the output of
static void Main(string[] args)
{
int? x = 20;
int? y = null;
int? z = x ?? y;
Console.WriteLine(z);
Console.ReadLine();
}
And why. What is the difference between
int x and int? x
Now, if we can say
int? element2;
//some code
If (element2.HasValue)
//Do something
What is the use of HasValue property?
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment