You are previewing Beginning C# 3.0.
O'Reilly logo
Beginning C# 3.0

Book Description

Learn all the basics of C# 3.0 from Beginning C# 3.0: An Introduction to Object Oriented Programming, a book that presents introductory information in an intuitive format. If you have no prior programming experience but want a thorough, easy-to-understand introduction to C# and Object Oriented Programming, this book is an ideal guide. Using the tutorials and hands-on coding examples, you can discover tried and true tricks of the trade, understand design concepts, employ debugging aids, and design and write C# programs that are functional and that embody safe programming practices.

Table of Contents

  1. Copyright
  2. Dedication
  3. About the Author
  4. Credits
  5. Acknowledgments
  6. Introduction
  7. Getting Started
    1. Getting Started
      1. A Short History of Object-Oriented Programming (OOP)
      2. Installing C#
      3. A Test Program Using C# Express
      4. Summary
    2. Understanding Objects
      1. Understanding Objects
      2. Developing a Program Plan
      3. Creating a Simple Application Using Objects
      4. Using C# to Implement Our Program Plan
      5. Summary
  8. Understanding C# Syntax
    1. Understanding Data Types
      1. Integer Data Types
      2. Monetary Values: The Decimal Data Type
      3. The Boolean Data Type
      4. Summary
      5. Exercises
    2. Understanding C# Statements
      1. Basic Building Blocks of a Programming Language
      2. Defining Variables
      3. Using a Variable in a Program
      4. The Bucket Analogy
      5. Types of Program Errors
      6. The Visual Studio Debugger
      7. Defensive Coding
      8. Summary
      9. Exercises
    3. Understanding Reference Data Types
      1. String Variables
      2. Strings and Escape Sequences
      3. DateTime Reference Objects
      4. Summary
      5. Exercises
    4. Making Decisions in Code
      1. Relational Operators
      2. Logical Operators
      3. The switch Statement
      4. Summary
      5. Exercises
    5. Statement Repetition Using Loops
      1. Program Loops
      2. do-while Program Loops
      3. The continue Statement
      4. Summary
      5. Exercises
    6. Arrays
      1. What is an Array?
      2. Arrays are Objects
      3. Multidimensional Arrays
      4. Initializing Arrays
      5. Collections
      6. ArrayList Objects
      7. Summary
      8. Exercises
  9. Writing Your Own Classes
    1. Designing Classes
      1. Class Design
      2. Designing a Program
      3. UML Light
      4. The clsDates Design
      5. User Interfaces Versus User Interfaces
      6. Summary
      7. Exercises
    2. Designing and Writing Custom Classes
      1. Constructors
      2. Property Methods
      3. What to Do if an Error Occurs in a Property Method
      4. Class Design for Deck-of-Cards Program
      5. Designing a Card Game Using clsCardDeck
      6. Summary
      7. Exercises
    3. Exception Handling and Debugging
      1. Overview
      2. Program Errors
      3. Exception Handling
      4. Program Debugging
      5. Summary
      6. Exercises
    4. Generics
      1. What are Generics?
      2. What are Generics?
      3. Generic Quicksort
      4. Summary
      5. Exercises
  10. Storing Data
  11. Using Disk Data Files
    1. Directories
    2. File Namespace
    3. FileInfo Class
    4. Types of Files
    5. Sequential Versus Random Access Files
    6. Serialization and Deserialization
    7. MDI, Menus, and File Dialogs
    8. Summary
    9. Exercises
  12. Using Databases
    1. What is a Database?
    2. Using Your Own Databases
    3. Using SQL
    4. Database Queries
    5. Using LINQ
    6. Summary
    7. Exercises
  13. Inheritance and Polymorphism
    1. What is Inheritance?
    2. Polymorphism
    3. Summary
    4. Exercises
  14. Exercise Solutions
    1. Chapter 3
    2. Chapter 4
    3. Chapter 5
    4. Chapter 6
    5. Chapter 7
    6. Chapter 8
    7. Chapter 9
    8. Chapter 10
    9. Chapter 11
    10. Chapter 12
    11. Chapter 13
    12. Chapter 14
    13. Chapter 15
  15. Index