O'Reilly logo

C# Web Development with ASP.NET: Visual QuickStart Guide by Jose Mojica

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. Types

In C# all code belongs to a type. Normally we represent types as classes, but types can also be structures, enumerations, interfaces, etc. Because every code belongs in a type, a number of tasks relating to types are important to understand when writing applications. These tasks include being able to compare variables, being able to determine if an object is compatible with a certain type, and being able to convert from one type to another.

Beyond basic comparisons of variables to types and learning mechanisms for casting from one type to another, this chapter will also give you information for redefining cast operators. Cast operators let you define conversion rules for your classes.

Working with Types

As with every chapter, we ...

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