Saturday 28 May 2016

value type

When we create variable using data types as int, bool, struct, enumeration this all target to direct value.

The value type consist two main categories:
  1. Struct
  2. Enumeration

Struct has following categories:
  1. Integer types
  2. floating point types
  3. decimal
  4. bool
  5. User defined struct
This all are stored value into heap memory.
A value type cannot contain null value but the null-able type does allow value type to be a null.
Each value type has an implicit default constructor that initializes the default value of that type.

Value type
Default value
false
0
'\0'
0.0M
0.0D
The value produced by the expression (E)0, where E is the enum identifier.
0.0F
0
0L
0
0
The value produced by setting all value-type fields to their default values and all reference-type fields to null.
0
0
0


you can also visit:  www.mybook-lang.com

No comments:

Post a Comment