Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to assign default value to nullable types? Did nested
nullable types are allowed

Answers were Sorted based on User's Feedback



How to assign default value to nullable types? Did nested nullable types are allowed..

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

How to assign default value to nullable types? Did nested nullable types are allowed..

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

Post New Answer

More C Sharp Interview Questions

What is delegates in c# and uses of delegates?

0 Answers  


What is windows form in c#?

0 Answers  


What are the advantages of generics in c#?

0 Answers  


How to transpose multi-dimensional array?

0 Answers   C DAC, CDAC,


How do you achieve polymorphism in c#?

0 Answers  


2. What happened when BO object has been called?

0 Answers   Mphasis,


What does assert() do?

2 Answers  


What are access modifiers used for?

0 Answers  


What is difference between "as" and "is" keyword?

1 Answers  


Write a program in c# to find the angle between the hours and minutes in a clock?

0 Answers  


What?s different about switch statements in C#?

2 Answers  


What do you understand by 'access specifiers' in C#?

0 Answers   Genpact,


Categories