In C#, types are divided into two categories:
- value types
- Reference types.
VALUE TYPES
In C#, a value type can be either a Struct or an enumeration. C# contains a set of predefined Struct types called the simple types. These simple types are identified through reserved words. All value types implicitly inherit from a class called object. Also, no type can derive from a value type. It is not possible for a value type to be null (null means “nothing” or “no value”). Assigning a variable of a value type creates a copy of the value. This is different from assigning a variable of a reference type, which copies the reference and not the object identified by the reference.
Example
Int,char,byte,bool,decimal ,double, enum , long ,sbyte,short ,struct,uint ,ulong ,ushort
Int,char,byte,bool,decimal ,double, enum , long ,sbyte,short ,struct,uint ,ulong ,ushort
Post A Comment:
0 comments: