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 |
If u declare two interfaces withsame methodnmae .prototype how can u call the particular method from class?
What are extender provider components?
an object,class is value type or refarance type. ?
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
How do you prevent a class from being inherited?
What is the namespace for datatable in c#?
What is the difference between static class and sealed class in c#?
What is difference between float and decimal?
What is constructors, explain with syntax
What is a deadlock lock?
What is the use of parse in c#?
How will you allow a class to be inherited, but prevent the method from being over-ridden?
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)