Sie sind auf Seite 1von 10

Contents

Chapters 2431 and Appendices DG are PDF documents posted online at the books Companion Website (located at www.pearsonhighered.com/deitel/).

Preface Before You Begin

xvii xxvii 1
2 2 4 4 4 5 6 6 7 7 8 9 9 10 12 15 15

1
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17

Introduction to Computers, the Internet and Visual C#


Introduction Computer Organization Personal Computing, Distributed Computing and Client/Server Computing Hardware Trends Microsofts Windows Operating System Machine Languages, Assembly Languages and High-Level Languages Visual Basic C, C++, Objective-C and Java C# The Internet and the World Wide Web Extensible Markup Language (XML) Introduction to Microsoft .NET The .NET Framework and the Common Language Runtime Test-Driving the Advanced Painter Application Introduction to Object Technology Wrap-Up Web Resources

2
2.1 2.2 2.3 2.4

Dive Into Visual C# 2010 Express


Introduction Overview of the Visual Studio 2010 IDE Menu Bar and Toolbar Navigating the Visual Studio IDE 2.4.1 Solution Explorer 2.4.2 Toolbox 2.4.3 Properties Window Using Help

24
25 25 30 32 34 35 36 37

2.5

viii 2.6 2.7 2.8

Contents Using Visual Programming to Create a Simple Program that Displays Text and an Image Wrap-Up Web Resources

40 51 52

3
3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10

Introduction to C# Applications
Introduction A Simple C# Application: Displaying a Line of Text Creating a Simple Application in Visual C# Express Modifying Your Simple C# Application Formatting Text with Console.Write and Console.WriteLine Another C# Application: Adding Integers Memory Concepts Arithmetic Decision Making: Equality and Relational Operators Wrap-Up

60
61 61 66 74 76 77 81 82 85 90

4
4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12

Introduction to Classes, Objects, Methods and strings


Introduction Classes, Objects, Methods, Properties and Instance Variables Declaring a Class with a Method and Instantiating an Object of a Class Declaring a Method with a Parameter Instance Variables and Properties UML Class Diagram with a Property Software Engineering with Properties and set and get Accessors Auto-Implemented Properties Value Types vs. Reference Types Initializing Objects with Constructors Floating-Point Numbers and Type decimal Wrap-Up

101
102 102 103 107 111 115 116 117 118 119 122 128

5
5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11

Control Statements: Part 1


Introduction Algorithms Pseudocode Control Structures if Single-Selection Statement ifelse Double-Selection Statement while Repetition Statement Formulating Algorithms: Counter-Controlled Repetition Formulating Algorithms: Sentinel-Controlled Repetition Formulating Algorithms: Nested Control Statements Compound Assignment Operators

136
137 137 138 138 140 141 146 147 152 160 165

Contents 5.12 5.13 5.14 Increment and Decrement Operators Simple Types Wrap-Up

ix 165 168 169

6
6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10

Control Statements: Part 2


Introduction Essentials of Counter-Controlled Repetition for Repetition Statement Examples Using the for Statement dowhile Repetition Statement switch Multiple-Selection Statement break and continue Statements Logical Operators Structured-Programming Summary Wrap-Up

183
184 184 186 190 194 196 203 205 211 216

7
7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17

Methods: A Deeper Look


Introduction Packaging Code in C# static Methods, static Variables and Class Math Declaring Methods with Multiple Parameters Notes on Declaring and Using Methods Method-Call Stack and Activation Records Argument Promotion and Casting The .NET Framework Class Library Case Study: Random-Number Generation 7.9.1 Scaling and Shifting Random Numbers 7.9.2 Random-Number Repeatability for Testing and Debugging Case Study: A Game of Chance (Introducing Enumerations) Scope of Declarations Method Overloading Optional Parameters Named Parameters Recursion Passing Arguments: Pass-by-Value vs. Pass-by-Reference Wrap-Up

226
227 227
229

232 236 237 237 239 241 245 245 246 251 253 256 257 258 261 264

8
8.1 8.2 8.3 8.4 8.5 8.6

Arrays
Introduction Arrays Declaring and Creating Arrays Examples Using Arrays Case Study: Card Shuffling and Dealing Simulation foreach Statement

280
281 281 282 284 293 298

x 8.7 8.8 8.9 8.10 8.11 8.12 8.13 8.14

Contents Passing Arrays and Array Elements to Methods Passing Arrays by Value and by Reference Case Study: Class GradeBook Using an Array to Store Grades Multidimensional Arrays Case Study: Class GradeBook Using a Rectangular Array Variable-Length Argument Lists Using Command-Line Arguments Wrap-Up 299 301 305 310 315 321 322 324

9
9.1 9.2 9.3 9.4 9.5 9.6 9.7

Introduction to LINQ and the List Collection 344


Introduction Querying an Array of int Values Using LINQ Querying an Array of Employee Objects Using LINQ Introduction to Collections Querying a Generic Collection Using LINQ Wrap-Up Deitel LINQ Resource Center 345 346 350 355 358 360 360

10
10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 10.12 10.13 10.14

Classes and Objects: A Deeper Look


Introduction Time Class Case Study Controlling Access to Members Referring to the Current Objects Members with the this Reference Time Class Case Study: Overloaded Constructors Default and Parameterless Constructors Composition Garbage Collection and Destructors static Class Members readonly Instance Variables Data Abstraction and Encapsulation Class View and Object Browser Object Initializers Wrap-Up

364
365 365 369 370 372 378 379 382 383 386 388 389 391 391

11
11.1 11.2 11.3 11.4

Object-Oriented Programming: Inheritance


Introduction Base Classes and Derived Classes protected Members Relationship between Base Classes and Derived Classes 11.4.1 Creating and Using a CommissionEmployee Class 11.4.2 Creating a BasePlusCommissionEmployee Class without Using Inheritance 11.4.3 Creating a CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy

398
399 400 402 403 403 408 414

Contents
CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables 11.4.5 CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables Constructors in Derived Classes Software Engineering with Inheritance Class object Wrap-Up

xi

11.4.4

417 421 426 427 428 429

11.5 11.6 11.7 11.8

12
12.1 12.2 12.3 12.4 12.5

OOP: Polymorphism, Interfaces and Operator Overloading


Introduction Polymorphism Examples Demonstrating Polymorphic Behavior Abstract Classes and Methods Case Study: Payroll System Using Polymorphism 12.5.1 Creating Abstract Base Class Employee 12.5.2 Creating Concrete Derived Class SalariedEmployee 12.5.3 Creating Concrete Derived Class HourlyEmployee 12.5.4 Creating Concrete Derived Class CommissionEmployee 12.5.5 Creating Indirect Concrete Derived Class
BasePlusCommissionEmployee

435
436 438 439 442 444 445 448 449 451 452 454 459 460 460 462 463 463 465 466 468 470 471 474

12.6 12.7

12.8 12.9

12.5.6 Polymorphic Processing, Operator is and Downcasting 12.5.7 Summary of the Allowed Assignments Between Base-Class and Derived-Class Variables sealed Methods and Classes Case Study: Creating and Using Interfaces 12.7.1 Developing an IPayable Hierarchy 12.7.2 Declaring Interface IPayable 12.7.3 Creating Class Invoice 12.7.4 Modifying Class Employee to Implement Interface IPayable 12.7.5 Modifying Class SalariedEmployee for Use with IPayable 12.7.6 Using Interface IPayable to Process Invoices and Employees Polymorphically 12.7.7 Common Interfaces of the .NET Framework Class Library Operator Overloading Wrap-Up

13
13.1 13.2 13.3

Exception Handling: A Deeper Look


Introduction Example: Divide by Zero without Exception Handling Example: Handling DivideByZeroExceptions and FormatExceptions 13.3.1 Enclosing Code in a try Block 13.3.2 Catching Exceptions

479
480 480 483 485 486

xii

Contents 13.3.3 Uncaught Exceptions 13.3.4 Termination Model of Exception Handling 13.3.5 Flow of Control When Exceptions Occur .NET Exception Hierarchy 13.4.1 Class SystemException 13.4.2 Determining Which Exceptions a Method Throws finally Block The using Statement Exception Properties User-Defined Exception Classes Wrap-Up 486 487 488 488 488 489 490 496 497 502 505

13.4

13.5 13.6 13.7 13.8 13.9

14
14.1 14.2 14.3

Graphical User Interfaces with Windows Forms: Part 1


Introduction Windows Forms Event Handling 14.3.1 A Simple Event-Driven GUI 14.3.2 Visual Studio Generated GUI Code 14.3.3 Delegates and the Event-Handling Mechanism 14.3.4 Another Way to Create Event Handlers 14.3.5 Locating Event Information Control Properties and Layout Labels, TextBoxes and Buttons GroupBoxes and Panels CheckBoxes and RadioButtons PictureBoxes ToolTips NumericUpDown Control Mouse-Event Handling Keyboard-Event Handling Wrap-Up

510
511 512 514 514 516 518 519 519 521 525 528 531 539 541 543 545 548 551

14.4 14.5 14.6 14.7 14.8 14.9 14.10 14.11 14.12 14.13

15
15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9

Graphical User Interfaces with Windows Forms: Part 2


Introduction Menus Control Control LinkLabel Control ListBox Control CheckedListBox Control ComboBox Control TreeView Control
MonthCalendar DateTimePicker

561
562 562 571 572 575 579 583 586 590

Contents 15.10 15.11 15.12 15.13 15.14 15.15 Control Control Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls Wrap-Up
ListView TabControl

xiii 595 601 606 613 618 622

16
16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 16.10 16.11 16.12 16.13 16.14 16.15 16.16

Strings and Characters


Introduction Fundamentals of Characters and Strings string Constructors string Indexer, Length Property and CopyTo Method Comparing strings Locating Characters and Substrings in strings Extracting Substrings from strings Concatenating strings Miscellaneous string Methods Class StringBuilder Length and Capacity Properties, EnsureCapacity Method and Indexer of Class StringBuilder Append and AppendFormat Methods of Class StringBuilder Insert, Remove and Replace Methods of Class StringBuilder Char Methods (Online) Introduction to Regular Expressions Wrap-Up

630
631 632 633 634 635 638 641 642 643 644 645 647 649 652 654 655

17
17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 17.10 17.11

Files and Streams


Introduction Data Hierarchy Files and Streams Classes File and Directory Creating a Sequential-Access Text File Reading Data from a Sequential-Access Text File Case Study: Credit Inquiry Program Serialization Creating a Sequential-Access File Using Object Serialization Reading and Deserializing Data from a Binary File Wrap-Up

661
662 662 664 665 674 683 687 693 694 698 700

18
18.1 18.2 18.3 18.4

Databases and LINQ


Introduction Relational Databases A Books Database LINQ to SQL

707
708 709 710 713

xiv 18.5

Contents 714 715 718 722 723 723 725 731 732 733 736 738 739 741 742

Querying a Database with LINQ 18.5.1 Creating LINQ to SQL Classes 18.5.2 Data Bindings Between Controls and the LINQ to SQL Classes 18.6 Dynamically Binding Query Results 18.6.1 Creating the Display Query Results GUI 18.6.2 Coding the Display Query Results Application 18.7 Retrieving Data from Multiple Tables with LINQ 18.8 Creating a Master/Detail View Application 18.8.1 Creating the Master/Detail GUI 18.8.2 Coding the Master/Detail Application 18.9 Address Book Case Study 18.9.1 Creating the Address Book Applications GUI 18.9.2 Coding the Address Book Application 18.10 Tools and Web Resources 18.11 Wrap-Up

19
19.1 19.2 19.3 19.4

Web App Development with ASP.NET

748
749 750 751 753 755 764 764 769 775 776
777

Introduction Web Basics Multitier Application Architecture Your First Web Application 19.4.1 Building the WebTime Application 19.4.2 Examining WebTime.aspxs Code-Behind File 19.5 Standard Web Controls: Designing a Form 19.6 Validation Controls 19.7 Session Tracking 19.7.1 Cookies 19.7.2 Session Tracking with HttpSessionState 19.7.3 Options.aspx: Selecting a Programming Language 19.7.4 Recommendations.aspx: Displaying Recommendations Based on Session Values 19.8 Case Study: Database-Driven ASP.NET Guestbook 19.8.1 Building a Web Form that Displays Data from a Database 19.8.2 Modifying the Code-Behind File for the Guestbook Application 19.9 Online Case Study: ASP.NET AJAX 19.10 Online Case Study: Password-Protected Books Database Application 19.11 Wrap-Up

780 783 785 787 790 792 792 792

20
20.1 20.2 20.3

Searching and Sorting


Introduction Searching Algorithms 20.2.1 Linear Search 20.2.2 Binary Search Sorting Algorithms 20.3.1 Selection Sort

799
800 801 801 805 810 810

Contents 20.3.2 Insertion Sort 20.3.3 Merge Sort Summary of the Efficiency of Searching and Sorting Algorithms Wrap-Up

xv 814 818 824 824

20.4 20.5

21
21.1 21.2 21.3 21.4 21.5 21.6 21.7

Data Structures
Introduction Simple-Type structs, Boxing and Unboxing Self-Referential Classes Linked Lists Stacks Queues Trees 21.7.1 Binary Search Tree of Integer Values 21.7.2 Binary Search Tree of IComparable Objects Wrap-Up

830
831 831 832 833 846 850 853 854 861 866

21.8

22
22.1 22.2 22.3 22.4 22.5 22.6 22.7

Generics
Introduction Motivation for Generic Methods Generic-Method Implementation Type Constraints Overloading Generic Methods Generic Classes Wrap-Up

873
874 875 877 880 882 883 892

23
23.1 23.2 23.3 23.4

Collections
Introduction Collections Overview Class Array and Enumerators Nongeneric Collections 23.4.1 Class ArrayList 23.4.2 Class Stack 23.4.3 Class Hashtable Generic Collections 23.5.1 Generic Class SortedDictionary 23.5.2 Generic Class LinkedList Covariance and Contravariance for Generic Types Wrap-Up

898
899 899 902 905 905 909 912 917 917 919 923 925

23.5

23.6 23.7

Chapters on the Web

932

xvi

Contents

A B C

Operator Precedence Chart Simple Types ASCII Character Set

933 935 937 938 939

Appendices on the Web Index

Chapters 2431 and Appendices DG are PDF documents posted online at the books Companion Website (located at www.pearsonhighered.com/deitel/).

24 25 26 27 28 29 30 31 D E F G

GUI with Windows Presentation Foundation WPF Graphics and Multimedia XML and LINQ to XML Web App Development with ASP.NET: A Deeper Look Windows Communication Foundation (WCF) Web Services Silverlight and Rich Internet Applications ATM Case Study, Part 1: Object-Oriented Design with the UML ATM Case Study, Part 2: Implementing an Object-Oriented Design Number Systems UML 2: Additional Diagram Types Unicode Using the Visual C# 2010 Debugger

Das könnte Ihnen auch gefallen