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

Answer Posted / aditya

Nullable type is introduced in .NET 2.0. Before 2.0 it was
not possible to assign null to value types.
This was possible with the introduction of Generics in 2.0
and the it would be something like this...

System.Nullable<int> x = new System.Nullable<int>;

or

int? salary = null (new type modifier in 2.0)

Is This Answer Correct ?    30 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is c# command?

499


Is string nullable c#?

494


What are native methods?

482


Define satellite Assembly in .NET?

555


Give an example of removing an element from the queue?

467






What does dbml mean in texting?

512


Explain the process of Serialization?

544


Can a struct inherit from another struct or class in c#?

516


Explain About stateless and state full web service

568


Difference between debug.write and trace.write?

519


In howmany ways can you deploy an assembly?

540


What is private class in c#?

480


Can a dictionary have the same key?

497


What is an icollection in c#?

487


What issues can be faced while delivering code?

1473