What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 60248 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > What is the use of ?? operator in C#? .. ...

What is the use of ?? operator in C#?

Interview question and answer by: Abhisek | Posted on: 1/21/2010 | Category: C# Interview questions | Views: 2042 |


Answer:

This operator allows you to assign a value to a nullable type if the retrieved value is in fact null.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Nandakumarpb | Posted on: 20 Aug 2010 12:20:31 AM | Points: 10 | Alert Moderator 

Double question mark(??) is not for the nullable type. See MSDN
The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand.
And This is a kind of Immediate if statement in VB6(?) IIF.
nullable type is declaration using single question mark(?).

I hope I am correct .

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Abhisek

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 7:29:28 AM