Synopses & Reviews
If you're a novice programmer and you want to learn C#, there aren't many books that will guide you. Most C# books are written for experienced C++ and Java programmers.That's why Jesse Liberty, author of the best-selling books Programming C# and Programming ASP.NET, has written an entry-level guide to C#.
Written in a warm and friendly manner, Learning C# assumes no prior programming experience, and provides a thorough introduction to Microsoft's premier .NET language. The book helps you build a solid foundation in .NET, and shows you how to apply your skills through the use of dozens of tested examples. You'll learn about the syntax and structure of the C# language, including operators, classes and interfaces, structs, arrays, and strings.
Better yet, this updated edition of Learning C# has been completely revised to include the latest additions to the C# language plus a variety of learning aids to help lock-in new knowledge and skills. Here's what's new:
- Extensive revisions to the text and examples to reflect C# 2005 and .NET 2.0 changes
- An introduction to Visual Studio 2005, the most popular tool for building Windows and web applications
- More than 200 questions and fully debugged programming exercises with solutions
- A greater emphasis on event handling
- New coverage of generics, generic collections, partial classes, anonymous methods and more.
By the time you've finished Learning C#, you'll be ready to move on to a more advanced programming guide that will help you create large-scale web and Windows applications.
Whether you have a little object-oriented programming experience or you are new to programming altogether, Learning C# will set you firmly on your way to mastering the essentials of the C# language.
About the Author
Jesse Liberty, Microsoft .NET MVP, is the best-selling author of O'Reilly Media's "Programming ASP.NET", "Programming C#", "Programming Visual Basic 2005" and over a dozen other books on web and object-oriented programming. He is president of Liberty Associates, Inc. where he provides contract programming, consulting and on-site training in .NET. Jesse is a frequent contributor to O'Reilly Network web sites as well as many industry publications and has spoken at numerous industry events. He is a former Distinguished Software Engineer at AT&T and Vice President for technology development at CitiBank.
Brian MacDonald has edited programming and networking books for major publishers on topics ranging from securing Windows servers to PHP web programming to running an eBay business. He also coauthored O'Reilly's Learning C# 2005 and Learning ASP.NET 2.0 with AJAX.
Table of Contents
Dedication; Preface; About This Book; Who This Book Is For; How the Book Is Organized; Conventions Used in This Book; Using Code Examples; Support; We'd Like to Hear from You; Safari® Enabled; Acknowledgments; Chapter 1: C# and .NET Programming; 1.1 C# 2005 and .NET 2.0; 1.2 The .NET Platform; 1.3 The .NET 2.0 Framework; 1.4 The C# Language; 1.5 The Structure of C# Applications; 1.6 The Development Environment; 1.7 What's in a Program?; 1.8 Your First Program: Hello World; 1.9 The Compiler; 1.10 Examining Your First Program; 1.11 Summary; 1.12 Quiz; 1.13 Exercise; Chapter 2: Visual Studio 2005; 2.1 Before You Read Further; 2.2 Start Page; 2.3 Projects and Solutions; 2.4 Inside the Integrated Development Environment; 2.5 Building and Running; 2.6 Menus and Toolbars; 2.7 Summary; 2.8 Quiz; 2.9 Exercise; Chapter 3: C# Language Fundamentals; 3.1 Statements; 3.2 Types; 3.3 Variables; 3.4 Definite Assignment; 3.5 Constants; 3.6 Strings; 3.7 Expressions; 3.8 Whitespace; 3.9 Summary; 3.10 Quiz; 3.11 Exercises; Chapter 4: Operators; 4.1 The Assignment Operator (=); 4.2 Mathematical Operators; 4.3 Increment and Decrement Operators; 4.4 Relational Operators; 4.5 Summary; 4.6 Quiz; 4.7 Exercises; Chapter 5: Branching; 5.1 Unconditional Branching Statements; 5.2 Conditional Branching Statements; 5.3 Iteration (Looping) Statements; 5.4 Summary; 5.5 Quiz; 5.6 Exercises; Chapter 6: Object-Oriented Programming; 6.1 Creating Models; 6.2 Classes and Objects; 6.3 Defining a Class; 6.4 Class Relationships; 6.5 The Three Pillars of Object-Oriented Programming; 6.6 Object-Oriented Analysis and Design; 6.7 Summary; 6.8 Quiz; 6.9 Exercises; Chapter 7: Classes and Objects; 7.1 Defining Classes; 7.2 Method Arguments; 7.3 Constructors; 7.4 Initializers; 7.5 The this Keyword; 7.6 Static and Instance Members; 7.7 Destroying Objects; 7.8 Memory Allocation: The Stack Versus the Heap; 7.9 Summary; 7.10 Quiz; 7.11 Exercises; Chapter 8: Inside Methods; 8.1 Overloading Methods; 8.2 Encapsulating Data with Properties; 8.3 Returning Multiple Values; 8.4 Summary; 8.5 Quiz; 8.6 Exercises; Chapter 9: Basic Debugging; 9.1 Setting a Breakpoint; 9.2 Examining Values: The Autos and Locals Windows; 9.3 Set Your Watch; 9.4 The Call Stack; 9.5 Summary; 9.6 Quiz; 9.7 Exercises; Chapter 10: Arrays; 10.1 Using Arrays; 10.2 The foreach Statement; 10.3 Initializing Array Elements; 10.4 The params Keyword; 10.5 Multidimensional Arrays; 10.6 Array Methods; 10.7 Sorting Arrays; 10.8 Summary; 10.9 Quiz; 10.10 Exercises; Chapter 11: Inheritance and Polymorphism; 11.1 Specialization and Generalization; 11.2 Inheritance; 11.3 Polymorphism; 11.4 Abstract Classes; 11.5 Sealed Classes; 11.6 The Root of All Classes: Object; 11.7 Boxing and Unboxing Types; 11.8 Summary; 11.9 Quiz; 11.10 Exercises; Chapter 12: Operator Overloading; 12.1 Using the operator Keyword; 12.2 Creating Useful Operators; 12.3 The Equals Operator; 12.4 Conversion Operators; 12.5 Summary; 12.6 Quiz; 12.7 Exercises; Chapter 13: Interfaces; 13.1 Implementing an Interface; 13.2 Implementing More than One Interface; 13.3 Casting to an Interface; 13.4 The is and as Operators; 13.5 Extending Interfaces; 13.6 Combining Interfaces; 13.7 Overriding Interface Implementations; 13.8 Explicit Interface Implementation; 13.9 Summary; 13.10 Quiz; 13.11 Exercises; Chapter 14: Generics and Collections; 14.1 Generics; 14.2 Collection Interfaces; 14.3 Creating Your Own Collections; 14.4 Framework Generic Collections; 14.5 Summary; 14.6 Quiz; 14.7 Exercises; Chapter 15: Strings; 15.1 Creating Strings; 15.2 Manipulating Strings; 15.3 Regular Expressions; 15.4 The Regex Class; 15.5 Summary; 15.6 Quiz; 15.7 Exercises; Chapter 16: Throwing and Catching Exceptions; 16.1 Bugs, Errors, and Exceptions; 16.2 Throwing Exceptions; 16.3 Searching for an Exception Handler; 16.4 The throw Statement; 16.5 The try and catch Statements; 16.6 How the Call Stack Works; 16.7 Creating Dedicated catch Statements; 16.8 The finally Statement; 16.9 Exception Class Methods and Properties; 16.10 Custom Exceptions; 16.11 Summary; 16.12 Quiz; 16.13 Exercises; Chapter 17: Delegates and Events; 17.1 Delegates; 17.2 Multicasting; 17.3 Events; 17.4 Using Anonymous Methods; 17.5 Summary; 17.6 Quiz; 17.7 Exercises; Chapter 18: Creating Windows Applications; 18.1 Creating a Simple Windows Form; 18.2 Creating a Real-World Application; 18.3 XML Documentation Comments; 18.4 Summary; 18.5 Quiz; 18.6 Exercises; Chapter 19: Programming ASP.NET Applications; 19.1 Understanding Web Forms; 19.2 Web Form Events; 19.3 Creating a Web Form; 19.4 Adding Controls; 19.5 Server Controls; 19.6 Data Binding; 19.7 Adding Controls and Events; 19.8 Summary; 19.9 Quiz; 19.10 Exercises; Answers to Quizzes and Exercises; Chapter 1: C# and .NET Programming; Chapter 2: Visual Studio 2005; Chapter 3: C# Language Fundamentals; Chapter 4: Operators; Chapter 5: Branching; Chapter 6: Object-Oriented Programming; Chapter 7: Classes and Objects; Chapter 8: Inside Methods; Chapter 9: Basic Debugging; Chapter 10: Arrays; Chapter 11: Inheritance and Polymorphism; Chapter 12: Operator Overloading; Chapter 13: Interfaces; Chapter 14: Generics and Collections; Chapter 15: Strings; Chapter 16: Throwing and Catching Exceptions; Chapter 17: Delegates and Events; Chapter 18: Creating Windows Applications; Chapter 19: Programming ASP.NET Applications; Colophon;