can we assign null value to value type in c#?

Answer Posted / narayana

Yes We can Assign
A nullable int can store null. Nullable types in the C#
language can be constructed by specifying the question mark
after a value type in a declarator statement. The nullable
int can be specified with the syntax "int?".

Example:
int a=b=10;
int? c= null;
c=a+b

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an assembly in .net?

572


Why hashtable is thread safe in c#?

491


how to sort an array in c#

565


What is difference between hashtable and dictionary in c#?

489


Which of the following operations can you not perform on an ado.net dataset?

510






What is dll file in c#?

519


Is null or empty in c#?

541


Is the following code legal?

561


What is the difference between system.text.stringbuilder and system.string?

527


How do you use nullable?

497


explain Garbage collector’s functionality on unmanaged code

514


Why do we need to serialize data?

497


Is c# good for web development?

537


What are the applications of c#?

466


What are extender provider components?

473