Buy Questpond's video subscriptions on
huge discount
.
Online: 1258
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
>
C#
>
Loading ...
what is the syntax of a nullable variable?
Posted by
Nishithraj
on 1/22/2010 | Category:
C# Interview questions
| Views: 4756
Post
|
Interview FAQs
|
Exclusive Questions
|
Interview Home
Answer:
Nullable myval=null;
Asked In:
Many Interviews |
Alert Moderator
Bookmark It
< Previous :
How can you check a nullable variable is assigned?
Next > :
I would like to check a variable as assigned or no ...
Comments or Responses
Posted by:
Raja
on: 1/22/2010
Hey Nish,
I do not think this is proper answer of the question. You should have give proper detail about the answer.
IN which language this syntax is used, can you please explain?
Posted by:
Utham
on: 9/27/2011 |
Points: 10
In C# you can write nullable datatype like this:
int? i = null;
DateTime? myDate = null;
Since these int and DateTime datatypes have default values if u dont initialize.. but here you are able to assign null values.
also there are two most useful methods of these nullable types.
if(myDate.HasValue){
//Checks whethe the value is there or not
}
myDate.GetVaueOrDefualt() --> Get the Value if exists otherwise gives default value of that datatype.
Login to post response
More Interview Questions by Nishithraj
I would like to check a variable as assigned or not. How can we do tha ...
What is Lean software development method?
What is the Scrum model?
What is Feature Driven Development model?
What's the abbrevation of DSDM? Explain DSDM?
What is Agile Data Method?
What is Agile Unified Process model?
What is Test-driven development method?
Latest Interview Questions
OOps Interview
how many type can maintain state at server side ?
how can debugging share point application and timer jobs ? with steps ...
What command is used to get back the privileges offered by the GRANT c ...
What do you mean by network communication standards?
What are the different layers of OSI model?
What is OSI reference model?
What is point-to-point protocol?
More ...