Skip to main content

Advanced C# Class Construction Techniques

  • Chapter
C# and the .NET Platform
  • 404 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics