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.

Table 7.2. Built-in Integral Types (C#)
Type (Keyword)Size.NET Framework Type
sbyteSigned 8-bit integerSystem.Sbyte
byteUnsigned 8-bit integerSystem.Byte
charUnicode 16-bit characterSystem.Char
shortSigned 16-bit integerSystem.Int16
ushortUnsigned 16-bit integerSystem.Uint16
intSigned 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.