C# is a
language. That means that every object you create or use in a C# program
must have a specific type (e.g., you must declare
the object to be an integer or a string or a Dog or a Button).
Essentially, the type indicates how big the object is (in memory) and
what it can do.
Types come in two flavors: those that are built into the language (intrinsic types ) and those you create (classes and interfaces, discussed in Chapters 7 and 13). C# offers a number of intrinsic types, shown in Table 3-1.
Table 3-1. The intrinsic types
Size (in bytes)
Unsigned (values 0-255).
True or false.
Signed (values -128 to 127).
Signed (short) (values -32,768 to 32,767).
Unsigned (short) (values 0 to 65,535).
Signed integer values between -2,147,483,648 and 2,147,483,647.
Unsigned integer values between 0 and 4,294,967,295.
Floating point number. Holds the values from approximately +/−1.5 * 10−45 to approximately +/−3.4 * 1038 with 7 significant figures.
Double-precision floating point; holds the values from approximately +/−5.0 * 10−324 to approximately +/−1.8 * 10308 with 15–16 significant figures.
Fixed-precision up to 28 digits and the position of the decimal point. This is typically used in financial calculations. Requires the suffix “m” or “M.”
Signed integers ...