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
Differentiate between object pooling and connection pooling in c#?
What are the properties of c#?
what is a constructor? What is a destructor?
Can the nested class access, the containing class. Give an example?
What is a verbatim string literal and why do we use it?
How is the syntax written to inherit from a class in C#?Give an example ?
Is unity object oriented?
What are some of the commonly used commands in sqlcommand?
what is inheritance and an example in vb.net and c# of when you might use it?
What is thread.sleep()?
Why do we use hashtable in c#?
How big is a 64 bit integer?
What is class and object c#?
What is the difference between Java and .NET garbage collectors?
explain the three services model commonly know as a three-tier application.