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 |
1. What is IIS. pl explain practically. 2. Difference b/w webserver and application server. pl explain practically.
Explain the various types of classes used in c#?
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
What is polymorphism in c sharp?
What is the difference between “constant” and “readonly” variables in c#?
List down the fundamental oop concepts?
What is the difference between malloc () and new?
Why we use delegates in c#?
What is difference between private, protected, and public in C#?
what is the Difference between the public and private ?
How does the lifecycle of Windows services differ from Standard EXE?
What is the difference between console application and windows application?