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

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


Please Help Members By Posting Answers For Below Questions

What is the use of oops in c#?

860


What is cache memory in c#?

864


What is toint32 c#?

996


What is msil in c#?

896


Is it possible to have different access modifiers on the get/set methods of a property?

941


What is the difference between as and is operators in c#?

869


Are c# constructors the same as c++ constructors?

895


What are the properties of a string class?

936


What's the difference between an integer and int?

985


Is there hashmap in c#?

867


How to use the sreamReader class to read form a text file?

941


What is generic in c#?

815


What are boxing and unboxing?

867


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

861


How is a strongly-named assembly different from one that isn’t strongly-named?

990