Chapter 5. ARRAYS AND COLLECTIONS


IN BRIEF

This chapter explains and demonstrates the different types of arrays and collections that are available in the .NET Framework. In the first section, you will learn about the different Array types and how to use each one. Next, you will learn the basics of the .NET Collection classes and how to iterate through the collections. Finally, you will learn how to create you own collection by descending from System.Collections.CollectionBase.

WHAT YOU NEED

RECOMMENDED SOFTWARE

.NET Framework

C# .NET environment

RECOMMENDED HARDWARE

.NET-enabled desktop client

SKILLS REQUIRED

C# coding


ARRAYS AND COLLECTIONS AT A GLANCE

Using Arrays

93

  
 

Understanding Single-Dimensional and Multidimensional Arrays

93

Explaining Jagged Arrays

95

 

Passing Arrays as Parameters

96

Collection Basics

98

  
 

Understanding the Basic Collection Interfaces

98

Iterating Through Collections

98

Collections Provided by the Base Class Libraries

99

  
 

Using an ArrayList

100

Using a BitArray

103

 

Using a Stack

101

Using the Queue

104

 

Using a Hashtable

102

Using a SortedList

106

Creating Custom Collections

107

  
 

Implementing the CollectionBase Class

107

Creating a AddressList Collection

107

Summary

109

  

Further Reading

110

  




    Visual C#. NET 2003 Unleashed
    Visual C#. NET 2003 Unleashed
    ISBN: 672326760
    EAN: N/A
    Year: 2003
    Pages: 316

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