What is Value type in C#?

Solution

Value types are directly derived from System.ValueType and directly stores the values.

Value type does not contains the NULL values instead each value type has a default constructor that assign it to default value. E.g. int has default value 0.

In C# we have major categories of Value types.

  • Struct
  • User defined struct
  • Enumration
  • Premitive types
    • Int
    • float
    • double
    • boolean
    • short
    • long
    • decimal
    • char

 

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media