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:
- Struct
- Enumeration
Struct has following categories:
- Integer types
- floating point types
- decimal
- bool
- 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