There are three types of Value Types:
1 Built-in
2 User-defined
3 Enumerations
Nullable type use:
Nullable<int> p;
int? p;
To determine whether a values has been assigned to the variable or not user p.HasValue.
System.Drawing.Point a user defined value Type.
System.Drawing.Point.Offset is used to move point location.
enum Titles : int { Mr, Ms, Mrs, Dr };
Titles T = Titles.Mr;
T.ToString(); will return “Mr”.
Mind it String Is Not a Value Type.
1 Built-in
2 User-defined
3 Enumerations
Nullable type use:
Nullable<int> p;
int? p;
To determine whether a values has been assigned to the variable or not user p.HasValue.
System.Drawing.Point a user defined value Type.
System.Drawing.Point.Offset is used to move point location.
enum Titles : int { Mr, Ms, Mrs, Dr };
Titles T = Titles.Mr;
T.ToString(); will return “Mr”.
Mind it String Is Not a Value Type.
Comments