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

Differentiate between object pooling and connection pooling in c#?

996


What are the properties of c#?

995


what is a constructor? What is a destructor?

984


Can the nested class access, the containing class. Give an example?

896


What is a verbatim string literal and why do we use it?

954


How is the syntax written to inherit from a class in C#?Give an example ?

1060


Is unity object oriented?

926


What are some of the commonly used commands in sqlcommand?

910


what is inheritance and an example in vb.net and c# of when you might use it?

953


What is thread.sleep()?

899


Why do we use hashtable in c#?

965


How big is a 64 bit integer?

902


What is class and object c#?

904


What is the difference between Java and .NET garbage collectors?

1035


explain the three services model commonly know as a three-tier application.

991