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
What is difference between write and writeline?
How to generate strong name key file or which command is used to generated strong name key file?
What are extensions methods in c#?
What are the steps to create a webservice and consume it?
can you allow a class to be inherited, but prevent the method from being over-ridden?
What is cookies in c# asp net?
List the two important objects of ado.net and also list the namespaces that are commonly used in ado.net to aid in connection to a database.
Is object an int c#?
Can You Prevent Your Class From Being Inherited By Another Class?
Is exe is machine dependent?
What is nameof c#?
What is c# most used for?
How to handle exceptions that are raised in a component?
What is use of abstract class in c#?
In which order the destructor is called for an inherited class?