How to assign default value to nullable types? Did nested
nullable types are allowed
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / msg
Nested nullable types are not allowed. The following line
will not compile:
Nullable<Nullable<int>> n;
- By MSG
| Is This Answer Correct ? | 1 Yes | 2 No |
Tell us something about static linking and dynamic linking?
What are the different types of delegation?
How to make a class non-inheritable other than sealed?
Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?
What is difference between ienumerable and enumerable in c#?
How many types of inheritance are there in c#?
In which format you can pass the value in the sleep function?
Can you declare the override method static while the original method is non-static?
Why are c# strings immutable?
what are the benefits in using c# ?
What are assemblies?
What is the Signification of the "new " keyword in C#? example
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)