Chapter 7. Data Types

Data types constitute the building blocks of any programming language. This chapter discusses the basic C# data types in detail and compares them to Java data types.

Recall that both C# and Java are strongly typed languages, meaning that all the variable declarations should identify the data type of the variable. C# has three data types: value types, reference types, and pointer types. Value types store data, whereas reference types store references to the actual data, and the pointer types can be used only in unsafe mode (more about unsafe mode later in the chapter). In Java, there is a similar demarcation between the data types; the value types are referred to as primitives, and reference types are references to arrays, ...

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.