Cover by Christian Nagel, Daniel Kemper, Morgan Skinner, Jon Reid, Jacob Vibe Hammer, Karli Watson

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

O'Reilly logo

Chapter 11

Collections, Comparisons, and Conversions

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How to define and use collections
  • The different types of collections that are available
  • How to compare types and use the is operator
  • How to compare values and overload operators
  • How to define and use conversions
  • How to use the as operator

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=9781118314418 on the Download Code tab. The code is in the Chapter 11 download and individually named according to the names throughout the chapter.

You’ve covered all the basic OOP techniques in C# now, but there are some more advanced techniques that are worth becoming familiar with. These techniques relate to certain problems that you must solve regularly when you are writing code. Learning about them will make it much easier to progress and allow you to concentrate on other, potentially more important aspects of your applications. In this chapter, you look at the following:

  • Collections — Collections enable you to maintain groups of objects. Unlike arrays, which you’ve used in earlier chapters, collections can include more advanced functionality, such as controlling access to the objects they contain, searching and sorting, and more. You’ll learn how to use and create collection classes and learn about some powerful techniques for getting the most out of them.
  • Comparisons — When dealing with objects, you often want to make ...

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