CHAPTER 3 CORE C# PROGRAMMING CONSTRUCTS, PART I
char
Yes
System.Char
U+0000 to U+ffff
Single 16-bit Unicode
character
float
Yes
System.Single
38
38
-3.4 10 to +3.4 10
32-bit floating-point
number
double
Yes
System.Double
±5.0 10–324 to ±1.7 10308
64-bit floating-point
number
decimal
Yes
System.Decimal
(-7.9 x 1028 to 7.9 x 1028) / (100
)
128-bit signed
number
string
Yes
System.String
Limited by system memory
Represents a set of
Unicode characters
Object
Yes
System.Object
Can store any data type in
an object variable
The base class of all
types in the .NET
universe
to 28
Note By default, a floating-point number is treated as a double. To declare a float variable, use the suffix f or
F to the raw numerical value (5.3F); suffix m or M to a floating-point number to declare a decimal (300.5M). Finally,
raw whole numbers default to an int data type. To set the underlying data type to a long, suffix l or L (4L).
Variable Declaration and Initialization
When you are declaring a local f&