You are previewing Visual C# 2010: How to Program, Fourth Edition.
O'Reilly logo
Visual C# 2010: How to Program, Fourth Edition

Book Description

Visual C# 2010 How to Program, Fourth Edition is appropriate for all basic-to-intermediate level courses in Visual C# 2010 programming. It is also ideal for basic to intermediate-level programmers.

Created by world-renowned programming instructors Paul and Harvey Deitel, Visual C# 2010 How to Program, Fourth Edition introduces all facets of the C# 2010 language hands-on, through hundreds of working programs. This book has been thoroughly updated to reflect the major innovations Microsoft has incorporated in Visual C# 2010 and .NET 4; all discussions and sample code have been carefully audited against the newest Visual C# language specification.

Students begin by getting comfortable with the C# Express 2010 IDE and basic Visual C# syntax. Next, they build their skills one step at a time, mastering control structures, classes, objects, methods, variables, arrays, and the core techniques of object-oriented programming. With this strong foundation in place, the Deitels introduce more sophisticated techniques, including searching, sorting, data structures, generics, and collections. Throughout, the authors show students how to make the most of Microsoft’s Visual Studio tools. A series of appendices provide essential programming reference material on topics ranging from number systems to the Visual Studio Debugger, UML 2 to Unicode and ASCII.

Table of Contents

  1. Visual C# 2010: How to Program, Fourth Edition
    1. Preface
      1. New and Updated Features
      2. Our Text + Digital Approach to Content
      3. Dependency Charts
        1. Dependency Chart for Print Chapters1
        2. Dependency Chart for Online Chapters
      4. Teaching Approach
      5. Student Resources and Software
      6. Deitel Online Resource Centers
      7. Instructor Supplements
      8. CourseSmart Web Books
      9. Microsoft Developer Network Academic Alliance (MSDNAA) and Microsoft DreamSpark
        1. Microsoft Developer Network Academic Alliance (MSDNAA)—Free Microsoft Software for Academic and Research Purposes
        2. Microsoft DreamSpark—Professional Developer and Designer Tools for Students
      10. Acknowledgments
        1. Reviewers
        2. Previous Edition Reviewers
      11. About the Authors
      12. About Deitel & Associates, Inc.
    2. Before You Begin
      1. Font and Naming Conventions
      2. A Note Regarding Software for the Book
      3. Hardware and Software Requirements for the Visual Studio 2010 Express Editions
      4. Desktop Theme Settings for Windows 7 Users
      5. Desktop Theme Settings for Windows Vista Users
      6. Desktop Theme Settings for Windows XP Users
      7. Viewing File Extensions
      8. Notes to Windows XP Users Regarding the Segoe UI Font Used in Many Applications
      9. Obtaining the Code Examples
      10. Installing the Software
      11. Miscellaneous Notes
    3. 1. Introduction to Computers, the Internet and Visual C#
        1. 1.1. Introduction
        2. 1.2. Computer Organization
        3. 1.3. Personal Computing, Distributed Computing and Client/Server Computing
        4. 1.4. Hardware Trends
        5. 1.5. Microsoft’s Windows® Operating System
        6. 1.6. Machine Languages, Assembly Languages and High-Level Languages
          1. Machine Languages
          2. Assembly Languages
          3. High-Level Languages
        7. 1.7. Visual Basic
        8. 1.8. C, C++, Objective-C and Java
        9. 1.9. C#
        10. 1.10. The Internet and the World Wide Web
        11. 1.11. Extensible Markup Language (XML)
        12. 1.12. Introduction to Microsoft .NET
        13. 1.13. The .NET Framework and the Common Language Runtime
        14. 1.14. Test-Driving the Advanced Painter Application
        15. 1.15. Introduction to Object Technology
          1. Basic Object-Technology Concepts
          2. Classes, Fields and Methods
          3. Introduction to Object-Oriented Analysis and Design (OOAD)
        16. 1.16. Wrap-Up
        17. 1.17. Web Resources
        1. Summary
          1. Section 1.1 Introduction
          2. Section 1.2 Computer Organization
          3. Section 1.3 Personal Computing, Distributed Computing and Client/Server Computing
          4. Section 1.4 Hardware Trends
          5. Section 1.5 Microsoft’s Windows® Operating System
          6. Section 1.6 Machine Languages, Assembly Languages and High-Level Languages
          7. Section 1.7 Visual Basic
          8. Section 1.8 C, C++, Objective-C and Java
          9. Section 1.9 C#
          10. Section 1.10 The Internet and the World Wide Web
          11. Section 1.11 Extensible Markup Language (XML)
          12. Section 1.12 Introduction to Microsoft .NET
          13. Section 1.13 The .NET Framework and the Common Language Runtime
          14. Section 1.14 Test-Driving the Advanced Painter Application
          15. Section 1.15 Introduction to Object Technology
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    4. 2. Dive Into® Visual C# 2010 Express
        1. 2.1. Introduction
        2. 2.2. Overview of the Visual Studio 2010 IDE
          1. Introduction to Microsoft Visual C# 2010 Express Edition
          2. Links on the Start Page
          3. Customizing the IDE and Creating a New Project
        3. 2.3. Menu Bar and Toolbar
        4. 2.4. Navigating the Visual Studio IDE
          1. 2.4.1. Solution Explorer
          2. 2.4.2. Toolbox
          3. 2.4.3. Properties Window
        5. 2.5. Using Help
          1. Context-Sensitive Help
        6. 2.6. Using Visual Programming to Create a Simple Program that Displays Text and an Image
        7. 2.7. Wrap-Up
        8. 2.8. Web Resources
        1. Summary
          1. Section 2.1 Introduction
          2. Section 2.2 Overview of the Visual Studio 2010 IDE
          3. Section 2.3 Menu Bar and Toolbar
          4. Section 2.4 Navigating the Visual Studio IDE
          5. Section 2.5 Using Help
          6. Section 2.6 Using Visual Programming to Create a Simple Program that Displays Text and an Image
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    5. 3. Introduction to C# Applications
        1. 3.1. Introduction
        2. 3.2. A Simple C# Application: Displaying a Line of Text
        3. 3.3. Creating a Simple Application in Visual C# Express
          1. Creating the Console Application
          2. Modifying the Editor Settings to Display Line Numbers
          3. Setting Code Indentation to Three Spaces per Indent
          4. Changing the Name of the Application File
          5. Writing Code and Using IntelliSense
          6. Saving the Application
          7. Compiling and Running the Application
          8. Running the Application from the Command Prompt
          9. Syntax Errors, Error Messages and the Error List Window
        4. 3.4. Modifying Your Simple C# Application
          1. Displaying a Single Line of Text with Multiple Statements
          2. Displaying Multiple Lines of Text with a Single Statement
        5. 3.5. Formatting Text with Console.Write and Console.WriteLine
        6. 3.6. Another C# Application: Adding Integers
        7. 3.7. Memory Concepts
        8. 3.8. Arithmetic
        9. 3.9. Decision Making: Equality and Relational Operators
        10. 3.10. Wrap-Up
        1. Summary
          1. Section 3.2 A Simple C# Application: Displaying a Line of Text
          2. Section 3.3 Creating a Simple Application in Visual C# Express
          3. Section 3.4 Modifying Your Simple C# Application
          4. Section 3.5 Formatting Text with Console.Write and Console.WriteLine
          5. Section 3.6 Another C# Application: Adding Integers
          6. Section 3.7 Memory Concepts
          7. Section 3.8 Arithmetic
          8. Section 3.9 Decision Making: Equality and Relational Operators
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    6. 4. Introduction to Classes, Objects, Methods and strings
        1. 4.1. Introduction
        2. 4.2. Classes, Objects, Methods, Properties and Instance Variables
          1. Methods
          2. Classes
          3. Objects
          4. Method Calls
          5. Attributes
          6. Properties, Get Accessors and Set Accessors
        3. 4.3. Declaring a Class with a Method and Instantiating an Object of a Class
          1. Class GradeBook
          2. Adding a Class to a Visual C# Project
          3. Class GradeBookTest
          4. UML Class Diagram for Class GradeBook
        4. 4.4. Declaring a Method with a Parameter
          1. More on Arguments and Parameters
          2. Updated UML Class Diagram for Class GradeBook
          3. Notes on using Directives
        5. 4.5. Instance Variables and Properties
          1. GradeBook Class with an Instance Variable and a Property
          2. Access Modifiers public and private
          3. Setting and Getting the Values of private Instance Variables
          4. GradeBook Class with a Property
          5. get and set Accessors
          6. Using Property CourseName in Method DisplayMessage
          7. GradeBookTest Class That Demonstrates Class GradeBook
        6. 4.6. UML Class Diagram with a Property
        7. 4.7. Software Engineering with Properties and set and get Accessors
        8. 4.8. Auto-Implemented Properties
          1. Code Snippets for Auto-implemented Properties
        9. 4.9. Value Types vs. Reference Types
        10. 4.10. Initializing Objects with Constructors
          1. Adding the Constructor to Class GradeBook’s UML Class Diagram
        11. 4.11. Floating-Point Numbers and Type decimal
          1. Real-Number Precision and Storage Requirements
          2. Account Class with an Instance Variable of Type decimal
          3. AccountTest Class to Use Class Account
          4. set and get Accessors with Different Access Modifiers
          5. UML Class Diagram for Class Account
        12. 4.12. Wrap-Up
        1. Summary
          1. Section 4.2 Classes, Objects, Methods, Properties and Instance Variables
          2. Section 4.3 Declaring a Class with a Method and Instantiating an Object of a Class
          3. Section 4.4 Declaring a Method with a Parameter
          4. Section 4.5 Instance Variables and Properties
          5. Section 4.6 UML Class Diagram with a Property
          6. Section 4.7 Software Engineering with Properties and set and get Accessors
          7. Section 4.8 Auto-Implemented Properties
          8. Section 4.9 Value Types vs. Reference Types
          9. Section 4.10 Initializing Objects with Constructors
          10. Section 4.11 Floating-Point Numbers and Type decimal
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    7. 5. Control Statements: Part 1
        1. 5.1. Introduction
        2. 5.2. Algorithms
        3. 5.3. Pseudocode
        4. 5.4. Control Structures
          1. Sequence Structure in C#
          2. Selection Structures in C#
          3. Repetition Structures in C#
          4. Summary of Control Statements in C#
        5. 5.5. if Single-Selection Statement
        6. 5.6. if...else Double-Selection Statement
          1. Conditional Operator (?:)
          2. Nested if...else Statements
          3. Dangling-else Problem
          4. Blocks
        7. 5.7. while Repetition Statement
        8. 5.8. Formulating Algorithms: Counter-Controlled Repetition
          1. Pseudocode Algorithm with Counter-Controlled Repetition
          2. Implementing Counter-Controlled Repetition in Class GradeBook
          3. Class GradeBookTest
          4. Notes on Integer Division and Truncation
        9. 5.9. Formulating Algorithms: Sentinel-Controlled Repetition
          1. Developing the Pseudocode Algorithm with Top-Down, Stepwise Refinement: The Top and First Refinement
          2. Proceeding to the Second Refinement
          3. Implementing Sentinel-Controlled Repetition in Class GradeBook
          4. Program Logic for Sentinel-Controlled Repetition vs. Counter-Controlled Repetition
          5. Explicitly and Implicitly Converting Between Simple Types
        10. 5.10. Formulating Algorithms: Nested Control Statements
          1. Complete Second Refinement of Pseudocode and Conversion to Class Analysis
        11. 5.11. Compound Assignment Operators
        12. 5.12. Increment and Decrement Operators
        13. 5.13. Simple Types
        14. 5.14. Wrap-Up
        1. Summary
          1. Section 5.2 Algorithms
          2. Section 5.3 Pseudocode
          3. Section 5.4 Control Structures
          4. Section 5.5 if Single-Selection Statement
          5. Section 5.6 if...else Double-Selection Statement
          6. Section 5.7 while Repetition Statement
          7. Section 5.8 Formulating Algorithms: Counter-Controlled Repetition
          8. Section 5.9 Formulating Algorithms: Sentinel-Controlled Repetition
          9. Section 5.10 Formulating Algorithms: Nested Control Statements
          10. Section 5.11 Compound Assignment Operators
          11. Section 5.12 Increment and Decrement Operators
          12. Section 5.13 Simple Types
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    8. 6. Control Statements: Part 2
        1. 6.1. Introduction
        2. 6.2. Essentials of Counter-Controlled Repetition
        3. 6.3. for Repetition Statement
        4. 6.4. Examples Using the for Statement
          1. Application: Summing the Even Integers from 2 to 20
          2. Application: Compound-Interest Calculations
        5. 6.5. do...while Repetition Statement
        6. 6.6. switch Multiple-Selection Statement
          1. GradeBook Class with switch Statement to Count A, B, C, D and F Grades
          2. Instance Variables
          3. Property CourseName, Method DisplayMessage and the Constructor
          4. Methods InputGrades and DisplayGradeReport
          5. Method IncrementLetterGradeCounter
          6. GradeBookTest Class That Demonstrates Class GradeBook
          7. switch Statement UML Activity Diagram
        7. 6.7. break and continue Statements
          1. break Statement
          2. continue Statement
        8. 6.8. Logical Operators
          1. Conditional AND (&&) Operator
          2. Conditional OR (||) Operator
          3. Short-Circuit Evaluation of Complex Conditions
          4. Boolean Logical AND (&) and Boolean Logical OR (|) Operators
          5. Boolean Logical Exclusive OR (^)
          6. Logical Negation (!) Operator
          7. Logical Operators Example
        9. 6.9. Structured-Programming Summary
        10. 6.10. Wrap-Up
        1. Summary
          1. Section 6.2 Essentials of Counter-Controlled Repetition
          2. Section 6.3 for Repetition Statement
          3. Section 6.4 Examples Using the for Statement
          4. Section 6.5 do...while Repetition Statement
          5. Section 6.6 switch Multiple-Selection Statement
          6. Section 6.7 break and continue Statements
          7. Section 6.8 Logical Operators
          8. Section 6.9 Structured-Programming Summary
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    9. 7. Methods: A Deeper Look
        1. 7.1. Introduction
        2. 7.2. Packaging Code in C#
        3. 7.3. static Methods, static Variables and Class Math
          1. Math Class Constants PI and E
          2. Why Is Method Main Declared static?
          3. Additional Comments about Method Main
        4. 7.4. Declaring Methods with Multiple Parameters
          1. The public and static Keywords
          2. Method Maximum
          3. Implementing Method Maximum by Reusing Method Math.Max
          4. Assembling Strings with String Concatenation
        5. 7.5. Notes on Declaring and Using Methods
        6. 7.6. Method-Call Stack and Activation Records
        7. 7.7. Argument Promotion and Casting
        8. 7.8. The .NET Framework Class Library
        9. 7.9. Case Study: Random-Number Generation
          1. Rolling a Six-Sided Die
          2. Rolling a Six-Sided Die 6000 Times
          3. 7.9.1. Scaling and Shifting Random Numbers
          4. 7.9.2. Random-Number Repeatability for Testing and Debugging
        10. 7.10. Case Study: A Game of Chance (Introducing Enumerations)
          1. Method RollDice
          2. Method Main’s Local Variables
          3. enum Type Status
          4. Logic of the Main Method
          5. Summary of the Craps Example
        11. 7.11. Scope of Declarations
        12. 7.12. Method Overloading
          1. Declaring Overloaded Methods
          2. Distinguishing Between Overloaded Methods
          3. Return Types of Overloaded Methods
        13. 7.13. Optional Parameters
        14. 7.14. Named Parameters
        15. 7.15. Recursion
          1. Recursive Factorial Calculations
        16. 7.16. Passing Arguments: Pass-by-Value vs. Pass-by-Reference
          1. ref and out Parameters
          2. Demonstrating ref, out and Value Parameters
        17. 7.17. Wrap-Up
        1. Summary
          1. Section 7.1 Introduction
          2. Section 7.2 Packaging Code in C#
          3. Section 7.3 static Methods, static Variables and Class Math
          4. Section 7.4 Declaring Methods with Multiple Parameters
          5. Section 7.5 Notes on Declaring and Using Methods
          6. Section 7.6 Method-Call Stack and Activation Records
          7. Section 7.7 Argument Promotion and Casting
          8. Section 7.8 The .NET Framework Class Library
          9. Section 7.9 Case Study: Random-Number Generation
          10. Section 7.10 Case Study: A Game of Chance (Introducing Enumerations)
          11. Section 7.11 Scope of Declarations
          12. Section 7.12 Method Overloading
          13. Section 7.13 Optional Parameters
          14. Section 7.14 Named Parameters
          15. Section 7.15 Recursion
          16. Section 7.16 Passing Arguments: Pass-by-Value vs. Pass-by-Reference
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    10. 8. Arrays
        1. 8.1. Introduction
        2. 8.2. Arrays
        3. 8.3. Declaring and Creating Arrays
          1. Resizing an Array
        4. 8.4. Examples Using Arrays
          1. Creating and Initializing an Array
          2. Using an Array Initializer
          3. Calculating a Value to Store in Each Array Element
          4. Summing the Elements of an Array
          5. Using Bar Charts to Display Array Data Graphically
          6. Using the Elements of an Array as Counters
          7. Using Arrays to Analyze Survey Results
          8. The frequency Array
          9. Summarizing the Results
          10. Exception Handling: Processing the Incorrect Response
          11. The try Statement
          12. Executing the catch Block
          13. Message Property of the Exception Parameter
        5. 8.5. Case Study: Card Shuffling and Dealing Simulation
          1. Class Card
          2. Class DeckOfCards
          3. Class DeckOfCards: Constructor
          4. Class DeckOfCards: Shuffle Method
          5. Class DeckOfCards: DealCard Method
          6. Shuffling and Dealing Cards
        6. 8.6. foreach Statement
        7. 8.7. Passing Arrays and Array Elements to Methods
        8. 8.8. Passing Arrays by Value and by Reference
        9. 8.9. Case Study: Class GradeBook Using an Array to Store Grades
          1. Storing Student Grades in an Array in Class GradeBook
          2. Class GradeBookTest That Demonstrates Class GradeBook
        10. 8.10. Multidimensional Arrays
          1. Rectangular Arrays
          2. Jagged Arrays
          3. Creating Two-Dimensional Arrays with Array-Creation Expressions
          4. Two-Dimensional Array Example: Displaying Element Values
          5. Common Multidimensional-Array Manipulations Performed with for Statements
        11. 8.11. Case Study: Class GradeBook Using a Rectangular Array
          1. Storing Student Grades in a Rectangular Array in Class GradeBook
          2. Class GradeBookTest That Demonstrates Class GradeBook
        12. 8.12. Variable-Length Argument Lists
        13. 8.13. Using Command-Line Arguments
        14. 8.14. Wrap-Up
        1. Summary
          1. Section 8.1 Introduction
          2. Section 8.2 Arrays
          3. Section 8.3 Declaring and Creating Arrays
          4. Section 8.4 Examples Using Arrays
          5. Section 8.5 Case Study: Card Shuffling and Dealing Simulation
          6. Section 8.6 foreach Statement
          7. Section 8.7 Passing Arrays and Array Elements to Methods
          8. Section 8.8 Passing Arrays by Value and by Reference
          9. Section 8.10 Multidimensional Arrays
          10. Section 8.11 Case Study: Class GradeBook Using a Rectangular Array
          11. Section 8.12 Variable-Length Argument Lists
          12. Section 8.13 Using Command-Line Arguments
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Special Section: Building Your Own Computer
        7. Making a Difference Exercise
    11. 9. Introduction to LINQ and the List Collection
        1. 9.1. Introduction
          1. LINQ Providers
        2. 9.2. Querying an Array of int Values Using LINQ
          1. The from Clause and Implicitly Typed Local Variables
          2. The var Keyword and Implicitly Typed Local Variables
          3. The where Clause
          4. The select Clause
          5. Iterating Through the Results of the LINQ Query
          6. LINQ vs. Repetition Statements
          7. The orderby Clause
          8. More on Implicitly Typed Local Variables
          9. An Aside: Interface IEnumerable<T>
        3. 9.3. Querying an Array of Employee Objects Using LINQ
          1. Accessing the Properties of a LINQ Query’s Range Variable
          2. Sorting a LINQ Query’s Results By Multiple Properties
          3. Any, First and Count Extension Methods
          4. Selecting a Portion of an Object
          5. Creating New Types in the select Clause of a LINQ Query
        4. 9.4. Introduction to Collections
        5. 9.5. Querying a Generic Collection Using LINQ
        6. 9.6. Wrap-Up
        7. 9.7. Deitel LINQ Resource Center
        1. Summary
          1. Section 9.1 Introduction
          2. Section 9.2 Querying an Array of int Values Using LINQ
          3. Section 9.3 Querying an Array of Employee Objects Using LINQ
          4. Section 9.4 Introduction to Collections
          5. Section 9.5 Querying a Generic Collection Using LINQ
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    12. 10. Classes and Objects: A Deeper Look
        1. 10.1. Introduction
        2. 10.2. Time Class Case Study
          1. Time1 Class Declaration
          2. Method SetTime and Throwing Exceptions
          3. Method ToUniversalString
          4. Method ToString
          5. Using Class Time1
          6. Calling Time Method SetTime with Invalid Values
          7. Notes on the Time1 Class Declaration
        3. 10.3. Controlling Access to Members
        4. 10.4. Referring to the Current Object’s Members with the this Reference
        5. 10.5. Time Class Case Study: Overloaded Constructors
          1. Class Time2 with Overloaded Constructors
          2. Class Time2’s Constructors
          3. Class Time2’s SetTime Method
          4. Notes Regarding Class Time2’s Methods, Properties and Constructors
          5. Using Class Time2’s Overloaded Constructors
        6. 10.6. Default and Parameterless Constructors
        7. 10.7. Composition
          1. Class Date
          2. Class Date’s private set Accessors
          3. Class Employee
          4. Class EmployeeTest
        8. 10.8. Garbage Collection and Destructors
        9. 10.9. static Class Members
          1. Class Employee
          2. Class EmployeeTest
        10. 10.10. readonly Instance Variables
        11. 10.11. Data Abstraction and Encapsulation
        12. 10.12. Class View and Object Browser
          1. Using the Class View Window
          2. Using the Object Browser
        13. 10.13. Object Initializers
        14. 10.14. Wrap-Up
        1. Summary
          1. Section 10.2 Time Class Case Study
          2. Section 10.3 Controlling Access to Members
          3. Section 10.4 Referring to the Current Object’s Members with the this Reference
          4. Section 10.5 Time Class Case Study: Overloaded Constructors
          5. Section 10.6 Default and Parameterless Constructors
          6. Section 10.7 Composition
          7. Section 10.8 Garbage Collection and Destructors
          8. Section 10.9 static Class Members
          9. Section 10.10 readonly Instance Variables
          10. Section 10.11 Data Abstraction and Encapsulation
          11. Section 10.12 Class View and Object Browser
          12. Section 10.13 Object Initializers
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    13. 11. Object-Oriented Programming: Inheritance
        1. 11.1. Introduction
        2. 11.2. Base Classes and Derived Classes
        3. 11.3. protected Members
        4. 11.4. Relationship between Base Classes and Derived Classes
          1. 11.4.1. Creating and Using a CommissionEmployee Class
            1. CommissionEmployee Class Overview
            2. CommissionEmployee Constructor
            3. CommissionEmployee Method Earnings
            4. CommissionEmployee Method ToString
            5. Class CommissionEmployeeTest
          2. 11.4.2. Creating a BasePlusCommissionEmployee Class without Using Inheritance
            1. Class BasePlusCommissionEmployeeTest
          3. 11.4.3. Creating a CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy
            1. A Derived Class’s Constructor Must Call Its Base Class’s Constructor
            2. BasePlusCommissionEmployee Method Earnings
          4. 11.4.4. CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables
            1. public vs. protected Data
            2. Class BasePlusCommissionEmployee
            3. Class BasePlusCommissionEmployeeTest
          5. 11.4.5. CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables
            1. BasePlusCommissionEmployee Method Earnings
            2. BasePlusCommissionEmployee Method ToString
            3. Class BasePlusCommissionEmployeeTest
        5. 11.5. Constructors in Derived Classes
        6. 11.6. Software Engineering with Inheritance
        7. 11.7. Class object
        8. 11.8. Wrap-Up
        1. Summary
          1. Section 11.1 Introduction
          2. Section 11.2 Base Classes and Derived Classes
          3. Section 11.3 protected Members
          4. Section 11.4.1 Creating and Using a CommissionEmployee Class
          5. Section 11.4.2 Creating a BasePlusCommissionEmployee Class without Using Inheritance
          6. Section 11.4.3 Creating a CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy
          7. Section 11.4.4 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables
          8. Section 11.4.5 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables
          9. Section 11.5 Constructors in Derived Classes
          10. Section 11.6 Software Engineering with Inheritance
          11. Section 11.7 Class object
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    14. 12. OOP: Polymorphism, Interfaces and Operator Overloading
        1. 12.1. Introduction
          1. Systems Are Easy to Extend
          2. Polymorphic Employee Inheritance Hierarchy
          3. Determining the Type of an Object at Execution Time
          4. Interfaces
          5. Operator Overloading
        2. 12.2. Polymorphism Examples
          1. Quadrilateral Inheritance Hierachy
          2. Video Game SpaceObject Inheritance Hierarchy
        3. 12.3. Demonstrating Polymorphic Behavior
        4. 12.4. Abstract Classes and Methods
          1. Polymorphism and Device Drivers
          2. Iterators
        5. 12.5. Case Study: Payroll System Using Polymorphism
          1. 12.5.1. Creating Abstract Base Class Employee
          2. 12.5.2. Creating Concrete Derived Class SalariedEmployee
          3. 12.5.3. Creating Concrete Derived Class HourlyEmployee
          4. 12.5.4. Creating Concrete Derived Class CommissionEmployee
          5. 12.5.5. Creating Indirect Concrete Derived Class BasePlusCommissionEmployee
          6. 12.5.6. Polymorphic Processing, Operator is and Downcasting
          7. Assigning Derived-Class Objects to Base-Class References
            1. Polymorphically Processing Employees
            2. Giving BasePlusCommissionEmployees 10% Raises
            3. Every Object Knows Its Own Type
            4. Avoiding Compilation Errors with Downcasting
          8. 12.5.7. Summary of the Allowed Assignments Between Base-Class and Derived-Class Variables
        6. 12.6. sealed Methods and Classes
        7. 12.7. Case Study: Creating and Using Interfaces
          1. 12.7.1. Developing an IPayable Hierarchy
          2. 12.7.2. Declaring Interface IPayable
          3. 12.7.3. Creating Class Invoice
          4. 12.7.4. Modifying Class Employee to Implement Interface IPayable
          5. 12.7.5. Modifying Class SalariedEmployee for Use with IPayable
          6. 12.7.6. Using Interface IPayable to Process Invoices and Employees Polymorphically
          7. 12.7.7. Common Interfaces of the .NET Framework Class Library
        8. 12.8. Operator Overloading
        9. 12.9. Wrap-Up
        1. Summary
          1. Section 12.1 Introduction
          2. Section 12.2 Polymorphism Examples
          3. Section 12.3 Demonstrating Polymorphic Behavior
          4. Section 12.4 Abstract Classes and Methods
          5. Section 12.5 Case Study: Payroll System Using Polymorphism
          6. Section 12.6 sealed Methods and Classes
          7. Section 12.7 Case Study: Creating and Using Interfaces
          8. Section 12.8 Operator Overloading
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercise
    15. 13. Exception Handling: A Deeper Look
        1. 13.1. Introduction
        2. 13.2. Example: Divide by Zero without Exception Handling
          1. Running the Application
          2. Analyzing the Results
        3. 13.3. Example: Handling DivideByZeroExceptions and FormatExceptions
          1. Sample Outputs
          2. Another Way to Convert Strings to Integers
          3. 13.3.1. Enclosing Code in a try Block
          4. 13.3.2. Catching Exceptions
          5. 13.3.3. Uncaught Exceptions
          6. 13.3.4. Termination Model of Exception Handling
          7. 13.3.5. Flow of Control When Exceptions Occur
        4. 13.4. .NET Exception Hierarchy
          1. 13.4.1. Class SystemException
          2. 13.4.2. Determining Which Exceptions a Method Throws
        5. 13.5. finally Block
          1. Moving Resource-Release Code to a finally Block
          2. Demonstrating the finally Block
          3. Throwing Exceptions Using the throw Statement
          4. Rethrowing Exceptions
          5. Returning After a finally Block
        6. 13.6. The using Statement
        7. 13.7. Exception Properties
          1. Property InnerException
          2. Other Exception Properties
          3. Demonstrating Exception Properties and Stack Unwinding
          4. Throwing an Exception with an InnerException
          5. Displaying Information About the Exception
        8. 13.8. User-Defined Exception Classes
          1. Class NegativeNumberException
          2. Class NegativeNumberException
        9. 13.9. Wrap-Up
        1. Summary
          1. Section 13.1 Introduction
          2. Section 13.2 Example: Divide by Zero without Exception Handling
          3. Section 13.3 Example: Handling DivideByZeroExceptions and FormatExceptions
          4. Section 13.4 .NET Exception Hierarchy
          5. Section 13.5 finally Block
          6. Section 13.6 The using Statement
          7. Section 13.7 Exception Properties
          8. Section 13.8 User-Defined Exception Classes
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    16. 14. Graphical User Interfaces with Windows Forms: Part 1
        1. 14.1. Introduction
        2. 14.2. Windows Forms
        3. 14.3. Event Handling
          1. 14.3.1. A Simple Event-Driven GUI
          2. 14.3.2. Visual Studio Generated GUI Code
          3. 14.3.3. Delegates and the Event-Handling Mechanism
            1. Delegates
            2. Indicating the Method that a Delegate Should Call
          4. 14.3.4. Another Way to Create Event Handlers
            1. Using the Properties Window to Create Event Handlers
          5. 14.3.5. Locating Event Information
        4. 14.4. Control Properties and Layout
          1. Anchoring and Docking
          2. Using Visual Studio To Edit a GUI’s Layout
        5. 14.5. Labels, TextBoxes and Buttons
        6. 14.6. GroupBoxes and Panels
        7. 14.7. CheckBoxes and RadioButtons
          1. CheckBoxes
          2. Combining Font Styles with Bitwise Operators
          3. RadioButtons
        8. 14.8. PictureBoxes
          1. Using Resources Programmatically
        9. 14.9. ToolTips
        10. 14.10. NumericUpDown Control
        11. 14.11. Mouse-Event Handling
        12. 14.12. Keyboard-Event Handling
        13. 14.13. Wrap-Up
        1. Summary
          1. Section 14.1 Introduction
          2. Section 14.2 Windows Forms
          3. Section 14.3 Event Handling
          4. Section 14.3.1 A Simple Event-Driven GUI
          5. Section 14.3.2 Visual Studio Generated GUI Code
          6. Section 14.3.3 Delegates and the Event-Handling Mechanism
          7. Section 14.3.4 Another Way to Create Event Handlers
          8. Section 14.3.5 Locating Event Information
          9. Section 14.4 Control Properties and Layout
          10. Section 14.5 Labels, TextBoxes and Buttons
          11. Section 14.6 GroupBoxes and Panels
          12. Section 14.7 CheckBoxes and RadioButtons
          13. Section 14.8 PictureBoxes
          14. Section 14.9 ToolTips
          15. Section 14.10 NumericUpDown Control
          16. Section 14.11 Mouse-Event Handling
          17. Section 14.12 Keyboard-Event Handling
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    17. 15. Graphical User Interfaces with Windows Forms: Part 2
        1. 15.1. Introduction
        2. 15.2. Menus
          1. Create the GUI
          2. Handling the Click Events for the About and Exit Menu Items
          3. Color Submenu Events
          4. Font Submenu Events
        3. 15.3. MonthCalendar Control
        4. 15.4. DateTimePicker Control
        5. 15.5. LinkLabel Control
        6. 15.6. ListBox Control
          1. Adding Items to ListBoxes and CheckedListBoxes
        7. 15.7. CheckedListBox Control
        8. 15.8. ComboBox Control
        9. 15.9. TreeView Control
        10. 15.10. ListView Control
          1. Method ListViewTestForm_Load
          2. Method LoadFilesInDirectory
          3. Method browserListView_Click
        11. 15.11. TabControl Control
        12. 15.12. Multiple Document Interface (MDI) Windows
          1. MDI Parent Form
          2. MDI Child Form
        13. 15.13. Visual Inheritance
          1. Creating a Base Form
          2. Steps for Declaring and Using a Reusable Class
          3. Step 1: Creating a public Class
          4. Step 2: Adding the namespace Declaration
          5. Step 3: Compiling the Class Library
          6. Step 4: Adding a Reference to the Class Library
          7. Step 5: Using the Class—Deriving From a Base Form
          8. Class VisualInheritanceTestForm
        14. 15.14. User-Defined Controls
          1. Method OnPaint
          2. Creating New Controls
          3. Clock Control
          4. Timers
          5. Adding a User Control
          6. Designing the User Control
          7. Sharing Custom Controls with Other Developers
        15. 15.15. Wrap-Up
        1. Summary
          1. Section 15.2 Menus
          2. Section 15.3 MonthCalendar Control
          3. Section 15.4 DateTimePicker Control
          4. Section 15.5 LinkLabel Control
          5. Section 15.6 ListBox Control
          6. Section 15.7 CheckedListBox Control
          7. Section 15.8 ComboBox Control
          8. Section 15.9 TreeView Control
          9. Section 15.10 ListView Control
          10. Section 15.11 TabControl Control
          11. Section 15.12 Multiple Document Interface (MDI) Windows
          12. Section 15.13 Visual Inheritance
          13. Section 15.14 User-Defined Controls
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    18. 16. Strings and Characters
        1. 16.1. Introduction
        2. 16.2. Fundamentals of Characters and Strings
        3. 16.3. string Constructors
        4. 16.4. string Indexer, Length Property and CopyTo Method
        5. 16.5. Comparing strings
          1. Comparing Strings with Equals, CompareTo and the Equality Operator (==)
          2. Determining Whether a String Begins or Ends with a Specified String
        6. 16.6. Locating Characters and Substrings in strings
        7. 16.7. Extracting Substrings from strings
        8. 16.8. Concatenating strings
        9. 16.9. Miscellaneous string Methods
        10. 16.10. Class StringBuilder
        11. 16.11. Length and Capacity Properties, EnsureCapacity Method and Indexer of Class StringBuilder
        12. 16.12. Append and AppendFormat Methods of Class StringBuilder
        13. 16.13. Insert, Remove and Replace Methods of Class StringBuilder
        14. 16.14. Char Methods
        15. 16.15. (Online) Introduction to Regular Expressions
        16. 16.16. Wrap-Up
        1. Summary
          1. Section 16.2 Fundamentals of Characters and Strings
          2. Section 16.3 string Constructors
          3. Section 16.4 string Indexer, Length Property and CopyTo Method
          4. Section 16.5 Comparing strings
          5. Section 16.6 Locating Characters and Substrings in strings
          6. Section 16.7 Extracting Substrings from strings
          7. Section 16.8 Concatenating strings
          8. Section 16.10 Class StringBuilder
          9. Section 16.11 Length and Capacity Properties, EnsureCapacity Method and Indexer of Class StringBuilder
          10. Section 16.12 Append and AppendFormat Methods of Class StringBuilder
          11. Section 16.13 Insert, Remove and Replace Methods of Class StringBuilder
          12. Section 16.14 Char Methods
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercises
    19. 17. Files and Streams
        1. 17.1. Introduction
        2. 17.2. Data Hierarchy
          1. Bits
          2. Characters
          3. Fields
          4. Records and Files
          5. Record Key
          6. Sequential Files
          7. Databases
        3. 17.3. Files and Streams
        4. 17.4. Classes File and Directory
          1. Demonstrating Classes File and Directory
          2. Searching Directories with LINQ
          3. Method SearchDirectory
          4. Method CleanDirectory
        5. 17.5. Creating a Sequential-Access Text File
          1. Class BankUIForm
          2. Class Record
          3. Using a Character Stream to Create an Output File
          4. Method saveButton_Click
          5. Method enterButton_Click
          6. Method exitButton_Click
          7. Sample Data
        6. 17.6. Reading Data from a Sequential-Access Text File
          1. Method openButton_Click
          2. Method nextButton_Click
        7. 17.7. Case Study: Credit Inquiry Program
        8. 17.8. Serialization
        9. 17.9. Creating a Sequential-Access File Using Object Serialization
          1. Defining the RecordSerializable Class
          2. Using a Serialization Stream to Create an Output File
        10. 17.10. Reading and Deserializing Data from a Binary File
        11. 17.11. Wrap-Up
        1. Summary
          1. Section 17.1 Introduction
          2. Section 17.2 Data Hierarchy
          3. Section 17.3 Files and Streams
          4. Section 17.4 Classes File and Directory
          5. Section 17.5 Creating a Sequential-Access Text File
          6. Section 17.6 Reading Data from a Sequential-Access Text File
          7. Section 17.7 Case Study: Credit Inquiry Program
          8. Section 17.8 Serialization
          9. Section 17.9 Creating a Sequential-Access File Using Object Serialization
          10. Section 17.10 Reading and Deserializing Data from a Binary File
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
        6. Making a Difference Exercise
    20. 18. Databases and LINQ
        1. 18.1. Introduction
        2. 18.2. Relational Databases
        3. 18.3. A Books Database
          1. Authors Table of the Books Database
          2. Titles Table of the Books Database
          3. AuthorISBN Table of the Books Database
          4. Foreign Keys
          5. Entity-Relationship Diagram for the Books Database
        4. 18.4. LINQ to SQL
          1. IQueryable Interface
          2. DataContext Class
        5. 18.5. Querying a Database with LINQ
          1. 18.5.1. Creating LINQ to SQL Classes
            1. Step 1: Creating the Project
            2. Step 2: Adding a Database to the Project and Connecting to the Database
            3. Step 3: Generating the LINQ to SQL classes
          2. 18.5.2. Data Bindings Between Controls and the LINQ to SQL Classes
            1. Step 1: Adding the Author LINQ to SQL Class as a Data Source
            2. Step 2: Creating GUI Elements
            3. Step 3: Connecting the BooksDataContext to the authorBindingSource
            4. Step 4: Saving Modifications Back to the Database
            5. Step 5: Configuring the Database File to Persist Changes
        6. 18.6. Dynamically Binding Query Results
          1. 18.6.1. Creating the Display Query Results GUI
            1. Step 1: Creating the Project
            2. Step 2: Creating the LINQ to SQL Classes
            3. Step 3: Creating a DataGridView to Display the Titles Table
            4. Step 4: Adding a ComboBox to the Form
          2. 18.6.2. Coding the Display Query Results Application
            1. Customizing the Form’s Load Event Handler
            2. Saving Changes
        7. 18.7. Retrieving Data from Multiple Tables with LINQ
          1. GUI for the Joining Tables with LINQ Application
          2. Creating the BooksDataContext
          3. Combining Author Names with the ISBNs of the Books They’ve Written
          4. Anonymous Types
          5. Combining Author Names with the Titles of the Books They’ve Written
          6. Organizing Book Titles by Author
        8. 18.8. Creating a Master/Detail View Application
          1. 18.8.1. Creating the Master/Detail GUI
            1. Step 1: Creating the Project
            2. Step 2: Creating LINQ to SQL Classes
            3. Step 3: Creating GUI Elements
          2. 18.8.2. Coding the Master/Detail Application
            1. Nested Class AuthorBinding
            2. Configuring the Data Sources
            3. The BindingSource of a DataGridView
            4. Method authorComboBox_SelectedIndexChanged
            5. Method titleComboBox_SelectedIndexChanged
        9. 18.9. Address Book Case Study
          1. 18.9.1. Creating the Address Book Application’s GUI
            1. Step 1: Creating the Project
            2. Step 2: Creating LINQ to SQL Classes and Data Source
            3. Step 3: Displaying the Details of Each Row
            4. Step 4: Dragging the Address Data-Source Node to the Form
            5. Step 5: Making the AddressID TextBox ReadOnly
            6. Step 6: Adding Controls to Allow Users to Specify a Last Name to Locate
            7. Step 7: Allowing the User to Return to Browsing All Rows of the Database
          2. 18.9.2. Coding the Address Book Application
            1. Method RefreshContacts
            2. Method Contacts_Load
            3. Method addressBindingNavigatorSaveItem_Click
            4. Method findButton_Click
            5. Method browseAllButton_Click
        10. 18.10. Tools and Web Resources
        11. 18.11. Wrap-Up
        1. Summary
          1. Section 18.1 Introduction
          2. Section 18.2 Relational Databases
          3. Section 18.3 A Books Database
          4. Section 18.4 LINQ to SQL
          5. Section 18.5 Querying a Database with LINQ
          6. Section 18.5.1 Creating LINQ to SQL Classes
          7. Section 18.5.2 Data Bindings Between Controls and the LINQ to SQL Classes
          8. Section 18.6 Dynamically Binding Query Results
          9. Section 18.7 Retrieving Data from Multiple Tables with LINQ
            1. Section 18.8 Creating a Master/Detail View Application
            2. Section 18.9 Address Book Case Study
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    21. 19. Web App Development with ASP.NET
        1. 19.1. Introduction
        2. 19.2. Web Basics
          1. URIs and URLs
          2. Parts of a URL
          3. Making a Request and Receiving a Response
        3. 19.3. Multitier Application Architecture
          1. Information Tier
          2. Business Logic
          3. Client Tier
        4. 19.4. Your First Web Application
          1. Testing the Application in Your Default Web Browser
          2. Testing the Application in a Selected Web Browser
          3. 19.4.1. Building the WebTime Application
            1. Step 1: Creating the Web Site Project
            2. Step 2: Adding a Web Form to the Website and Examining the Solution Explorer
            3. The Solution Explorer
            4. The Toolbox
            5. The Web Forms Designer
            6. Step 3: Changing the Title of the Page
            7. Designing a Page
            8. Step 4: Adding Text and a Label
            9. Step 5: Formatting the Label
            10. Step 6: Adding Page Logic
            11. Step 7: Setting the Start Page and Running the Program
          4. 19.4.2. Examining WebTime.aspx’s Code-Behind File
        5. 19.5. Standard Web Controls: Designing a Form
          1. A Form Gathering User Input
          2. Creating the Web Site
          3. Adding the Images to the Project
          4. Adding Text and an Image to the Form
          5. Adding a Table to the Form
          6. Creating the Publications Section of the Page
          7. Completing the Page
        6. 19.6. Validation Controls
          1. Validating Input in a Web Form
          2. Creating the Web Site
          3. Creating the GUI
          4. Using RequiredFieldValidator Controls
          5. Using RegularExpressionValidator Controls
          6. Submitting the Web Form’s Contents to the Server
          7. Examining the Code-Behind File for a Web Form That Receives User Input
          8. Differentiating Between the First Request to a Page and a Postback
          9. Server-Side Web Form Validation
          10. Processing the Data Entered by the User
        7. 19.7. Session Tracking
          1. Personalization
          2. Privacy
          3. Recognizing Clients
          4. 19.7.1. Cookies
          5. 19.7.2. Session Tracking with HttpSessionState
            1. Creating the Web Site
          6. 19.7.3. Options.aspx: Selecting a Programming Language
            1. Session Property of a Page
            2. Code-Behind File for Options.aspx
            3. Postback Processing
            4. Method submitButton_Click
          7. 19.7.4. Recommendations.aspx: Displaying Recommendations Based on Session Values
            1. Code-Behind File for Recommendations.aspx
        8. 19.8. Case Study: Database-Driven ASP.NET Guestbook
          1. The Guestbook Database
          2. Testing the Application
          3. 19.8.1. Building a Web Form that Displays Data from a Database
            1. Step 1: Creating the Web Site
            2. Step 2: Creating the Form for User Input
            3. Step 3: Adding a GridView Control to the Web Form
            4. Step 4: Adding a Database to an ASP.NET Web Application
            5. Step 5: Creating the LINQ to SQL Classes
            6. Step 6: Binding the GridView to the Messages Table of the Guestbook Database
            7. Step 7: Modifying the Columns of the Data Source Displayed in the GridView
          4. 19.8.2. Modifying the Code-Behind File for the Guestbook Application
        9. 19.9. Online Case Study: ASP.NET AJAX
        10. 19.10. Online Case Study: Password-Protected Books Database Application
        11. 19.11. Wrap-Up
        1. Summary
          1. Section 19.1 Introduction
          2. Section 19.2 Web Basics
          3. Section 19.3 Multitier Application Architecture
          4. Section 19.4.1 Building the WebTime Application
          5. Section 19.4.2 Examining WebTime.aspx’s Code-Behind File
          6. Section 19.5 Standard Web Controls: Designing a Form
          7. Section 19.6 Validation Controls
          8. Section 19.7 Session Tracking
          9. Section 19.7.1 Cookies
          10. Section 19.7.2 Session Tracking with HttpSessionState
          11. Section 19.7.3 Options.aspx: Selecting a Programming Language
          12. Section 19.7.4 Recommendations.aspx: Displaying Recommendations Based on Session Values
          13. Section 19.8 Case Study: Database-Driven ASP.NET Guestbook
          14. Section 19.8.1 Building a Web Form that Displays Data from a Database
          15. Section 19.8.2 Modifying the Code-Behind File for the Guestbook Application
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    22. 20. Searching and Sorting
        1. 20.1. Introduction
        2. 20.2. Searching Algorithms
          1. 20.2.1. Linear Search
            1. Efficiency of Linear Search
          2. 20.2.2. Binary Search
            1. Efficiency of Binary Search
        3. 20.3. Sorting Algorithms
          1. 20.3.1. Selection Sort
            1. Efficiency of Selection Sort
          2. 20.3.2. Insertion Sort
            1. Efficiency of Insertion Sort
          3. 20.3.3. Merge Sort
            1. Efficiency of Merge Sort
        4. 20.4. Summary of the Efficiency of Searching and Sorting Algorithms
        5. 20.5. Wrap-Up
        1. Summary
          1. Section 20.1 Introduction
          2. Section 20.2.1 Linear Search
          3. Section 20.2.2 Binary Search
          4. Section 20.3.1 Selection Sort
          5. Section 20.3.2 Insertion Sort
          6. Section 20.3.3 Merge Sort
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    23. 21. Data Structures
        1. 21.1. Introduction
        2. 21.2. Simple-Type structs, Boxing and Unboxing
          1. Simple-Type structs
          2. Boxing and Unboxing Conversions
        3. 21.3. Self-Referential Classes
        4. 21.4. Linked Lists
          1. Linked-List Implementation
          2. Class ListNode
          3. Class List
          4. Class EmptyListException
          5. Class ListTest
          6. Method InsertAtFront
          7. Method InsertAtBack
          8. Method RemoveFromFront
          9. Method RemoveFromBack
          10. Method Display
          11. Linear and Circular Singly Linked and Doubly Linked Lists
        5. 21.5. Stacks
          1. Stack Class That Inherits from List
          2. Stack Class That Contains a Reference to a List
        6. 21.6. Queues
          1. Queue Class That Inherits from List
        7. 21.7. Trees
          1. Basic Terminology
          2. Binary Search Trees
          3. 21.7.1. Binary Search Tree of Integer Values
            1. Inorder Traversal Algorithm
            2. Preorder Traversal Algorithm
            3. Postorder Traversal Algorithm
            4. Duplicate Elimination
            5. Overview of the Binary-Tree Exercises
          4. 21.7.2. Binary Search Tree of IComparable Objects
        8. 21.8. Wrap-Up
        1. Summary
          1. Section 21.1 Introduction
          2. Section 21.2 Simple-Type structs, Boxing and Unboxing
          3. Section 21.3 Self-Referential Classes
          4. Section 21.4 Linked Lists
          5. Section 21.5 Stacks
          6. Section 21.6 Queues
          7. Section 21.7 Trees
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    24. 22. Generics
        1. 22.1. Introduction
        2. 22.2. Motivation for Generic Methods
        3. 22.3. Generic-Method Implementation
        4. 22.4. Type Constraints
          1. IComparable<T> Interface
          2. Specifying Type Constraints
          3. Analyzing the Code
        5. 22.5. Overloading Generic Methods
        6. 22.6. Generic Classes
          1. Creating Generic Methods to Test Class Stack< T >
        7. 22.7. Wrap-Up
        1. Summary
          1. Section 22.1 Introduction
          2. Section 22.2 Motivation for Generic Methods
          3. Section 22.3 Generic-Method Implementation
          4. Section 22.4 Type Constraints
          5. Section 22.5 Overloading Generic Methods
          6. Section 22.6 Generic Classes
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    25. 23. Collections
        1. 23.1. Introduction
        2. 23.2. Collections Overview
        3. 23.3. Class Array and Enumerators
        4. 23.4. Nongeneric Collections
          1. 23.4.1. Class ArrayList
          2. 23.4.2. Class Stack
          3. 23.4.3. Class Hashtable
            1. Problems with Nongeneric Collections
        5. 23.5. Generic Collections
          1. 23.5.1. Generic Class SortedDictionary
          2. 23.5.2. Generic Class LinkedList
        6. 23.6. Covariance and Contravariance for Generic Types
          1. Covariance in Arrays
          2. Covariance in Generic Types
          3. Contravariance in Arrays
          4. Contravariance in Generic Types
          5. Web Resources
        7. 23.7. Wrap-Up
        1. Summary
          1. Section 23.1 Introduction
          2. Section 23.2 Collections Overview
          3. Section 23.3 Class Array and Enumerators
          4. Section 23.4.1 Class ArrayList
          5. Section 23.4.2 Class Stack
          6. Section 23.4.3 Class Hashtable
          7. Section 23.5.1 Generic Class SortedDictionary
          8. Section 23.5.2 Generic Class LinkedList
          9. Section 23.6 Covariance and Contravariance for Generic Types
        2. Terminology
        3. Self-Review Exercises
        4. Answers to Self-Review Exercises
        5. Exercises
    26. Chapters on the Web
    27. A. Operator Precedence Chart
    28. B. Simple Types
        1. Additional Simple Type Information
    29. C. ASCII Character Set
    30. Appendices on the Web