Skip to main content
  • 3797 Accesses

Abstract

This chapter builds upon your current understanding of object-oriented development by examining the topic of interface-based programming. Here you’ll learn how to define and implement interfaces, and come to understand the benefits of building types that support multiple behaviors. Along the way, I’ll also discuss a number of related topics, such as obtaining interface references, explicit interface implementation, and the construction of interface hierarchies. We’ll also examine a number of standard interfaces defined within the .NET base class libraries. As you will see, your custom classes and structures are free to implement these predefined interfaces to support a number of useful behaviors, such as object cloning, object enumeration, and object sorting.

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 79.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

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.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Andrew Troelsen

About this chapter

Cite this chapter

Troelsen, A. (2012). Working with Interfaces. In: Pro C# 5.0 and the .NET 4.5 Framework. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4234-5_8

Download citation

Publish with us

Policies and ethics