7.4. The Built-in Value Types
As mentioned earlier, all C# types inherit from the System.Object class, and therefore most of the built-in types that we will discuss have a representation in the System namespace. For example, int is a keyword that is used to represent an integer value type, and it is also represented by the System.Int32 class. The simple built-in types can be further classified as integral types, floating-point types, decimal types, and Boolean types.
Type (Keyword) | Size | .NET Framework Type |
---|---|---|
sbyte | Signed 8-bit integer | System.Sbyte |
byte | Unsigned 8-bit integer | System.Byte |
char | Unicode 16-bit character | System.Char |
short | Signed 16-bit integer | System.Int16 |
ushort | Unsigned 16-bit integer | System.Uint16 |
int | Signed 32-bit ... |
Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.