Chapter 26. C# structures

Structs (structures) in the C language were used very commonly long before OO programming became popular. [1] They are used to group together multiple primitive data types to create a new data type (or data structure). Today, OO classes have taken over much of the functionality of structs, but they are still relevant in C# because careful use of structs can improve the performance of a program significantly. [2]

[1] Structs in C# are slightly different from structs in C++ (and significantly different from the original structs in C). So even if you are familiar with C/C++, it is not recommended to skip this chapter.

[2] I have to note too, that poor use of structs can also decrease performance. For this reason, I think ...

Get From Java to C#: A Developer's Guide 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.