Chapter 11: Collections, Comparisons, and Conversions


Overview

You've covered all the basic OOP techniques in C# now, but there are some more advanced techniques that are worth becoming familiar with. 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 so on. You'll see how to use and create collection classes, and also learn about some powerful techniques for getting the most out of them.

  • Comparisons: Often when dealing with objects, you will want to make comparisons between them. This is especially important in collections, since it is how sorting is achieved. You'll look at how to compare objects in a number of ways, including operator overloading and using the IComparable and IComparer interface to sort collections.

  • Conversions: In earlier chapters, you've seen how to cast objects from one type into another. In this chapter, you round things off by looking at how type conversions can be customized to suit your needs.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net