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

Answer Posted / yogesh

Cannot convert null to a value type.
So it is not possible to assign null to value type.

Value types include:
All numeric data types
Boolean, Char, and Date
All structures, even if their members are reference types
Enumerations, since their underlying type is always
Byte, Short, Integer, or Long

Reference types include:
String
All arrays, even if their elements are value types
Class types, such as Form
Delegates

Is This Answer Correct ?    20 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the value types in c#?

509


Is arraylist generic in c#?

472


Is c++ or c# better?

542


Explain the difference between a sub and a function in c#.

532


Can you see a loop recorder?

499






Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!

16615


How do I unload an application domain?

526


Can destructors have access modifiers?

566


Explain About friend and Protected friend

523


Why are mutable structs evil?

541


What is an example of a delegate?

510


What is the difference between class and namespace?

490


Why do we use overloading in c#?

480


What is the use of regex in c#?

496


What does the initial catalog parameter define in the connection string?

485