O'Reilly logo

C#: A Beginner's Tutorial by Jayden Ky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7

Structures

In Introduction you learned that .NET types consists of classes, structures, enumerations, interfaces, and delegates. Classes were discussed in Chapter 4, “Objects and Classes” and you should be familiar with them by now.

The second type, structures or simply structs, are like classes, in which they can have members like fields and methods. Unlike classes, however, structures are value types and cannot inherit or be inherited. The .NET Framework class library offers many of them. For example, the System namespace defines important structures like Byte, Char, Int32, and DateTime that represent important data types.

This chapter explains what a structure is and shows a couple of examples.

An Overview of Structures

Sometimes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required