How to assign default value to nullable types? Did nested
nullable types are allowed
Answer Posted / msg
Here we have two ways to assign a default value.
1. By using Nullcoalsce(??) Operartor
2. by using getvalueordefault() Method.
ex: int? a= null;
int b = a ?? 10;
Or
int b =a.getvalueordefault(); //if null will return zero
or
int b = a. getvalueordefault(10);// if null will retrun 10
--Nested nullable types are NOT Allowed
-By MSG
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used
What is clr in c#?
Why is lazy loading?
How do I register my code for use by classic com clients?
What are collections in c#?
What is int32 maxvalue?
What is the difference between “constant” and “readonly” variables in c#?
What is jit? What are the different types of jit?
How to achieve polymorphism in c#?
What is visual c# net?
What is difference between destructor and finalize?
How does c# generics and c++ templates compare?
what is scope of a protected internal member variable of a c# class
What is the difference between abstract class and interface in c#?
If the original method is not static you can declare an override method to be static or not?