Abstract
This chapter rounds out your introduction to the core aspects of the C# language by examining a number of advanced (but extremely useful) syntactic constructs. To begin, you learn how to construct and use an indexer method. This C# mechanism enables you to build custom types, which exposes internal subtypes using the familiar bracket operator (i.e., []). If you have a C++ background, you will find that creating a C# indexer method is analogous to overloading the [] operator on a C++ class. Once you learn how to build an indexer, you then examine how to overload various operators (+, −, <, > and so forth) for a custom C# type.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2001 Andrew Troelsen
About this chapter
Cite this chapter
Troelsen, A. (2001). Advanced C# Class Construction Techniques. In: C# and the .NET Platform. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-1141-9_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-1141-9_5
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-893115-59-0
Online ISBN: 978-1-4302-1141-9
eBook Packages: Springer Book Archive