Table of contents for C# software solutions / John Lewis.

Bibliographic record and links to related information available from the Library of Congress catalog.

Note: Contents data are machine generated based on pre-publication provided by the publisher. Contents may have variations from the printed book or be incomplete or contain other coding.


Counter
Preface vii
Chapter 1 Introduction 1
1.1 Computer Processing 2
Software Categories 3
Digital Computers 5
Binary Numbers 7
1.2 Hardware Components 10
Computer Architecture 10
Input/Output Devices 12
Main Memory and Secondary Memory 13
The Central Processing Unit 17
1.3 Networks 19
Network Connections 19
Local-Area Networks and Wide-Area Networks 21
The Internet 22
The World Wide Web 24
Uniform Resource Locators 25
1.4 The C# Programming Language 26
A C# Program 27
Comments 29
Identifiers and Reserved Words 31
White Space 33
1.5 Program Development 35
Programming Language Levels 36
Editors, Compilers, and Interpreters 38
Development Environments 40
Syntax and Semantics 41
Errors 42
1.6 Object-Oriented Programming 43
Problem Solving 44
Object-Oriented Software Principles 45
Chapter 2 Data and Expressions 61
2.1 Character Strings 62
The print and printlnMethods 62
String Concatenation 64
Escape Sequences 66
2.2 Variables and Assignment 69
Variables 69
The Assignment Statement 71
Constants 73
2.3 Primitive Data Types 73
Integers and Floating Points 74
Characters 75
Booleans 77
2.4 Expressions 77
Arithmetic Operators 78
Operator Precedence 78
Increment and Decrement Operators 83
Assignment Operators 84
2.5 Data Conversion 85
Conversion Techniques 87
2.6 Interactive Programs 88
The ScannerClass 88
2.7 Graphics 93
Coordinate Systems 94
Representing Color 95
CONTENTS xxi
2.8 Applets 96
Executing Applets Using the Web 98
2.9 Drawing Shapes 99
The GraphicsClass 99
Chapter 3 Using Classes and Objects 113
3.1 Creating Objects 114
Aliases 116
3.2 The StringClass 118
3.3 Packages 121
The import Declaration 122
3.4 The RandomClass 124
3.5 The MathClass 127
3.6 Formatting Output 130
The NumberFormatClass 130
The DecimalFormatClass 133
The printfMethod 135
3.7 Enumerated Types 135
3.8 Wrapper Classes 138
Autoboxing 141
3.9 Components and Containers 141
Frames and Panels 142
3.10 Nested Panels 145
3.11 Images 148
xxii CONTENTS
Chapter 4 Writing Classes 155
4.1 Anatomy of a Class 156
Instance Data 161
UML Class Diagrams 162
4.2 Encapsulation 163
Visibility Modifiers 164
Accessors and Mutators 165
4.3 Anatomy of a Method 166
The returnStatement 167
Parameters 169
Local Data 170
Bank Account Example 171
4.4 Constructors Revisited 175
4.5 Graphical Objects 175
4.6 Graphical User Interfaces 184
4.7 Buttons 185
4.8 Text Fields 189
Chapter 5 Conditionals and Loops 201
5.1 Boolean Expressions 202
Equality and Relational Operators 203
Logical Operators 204
5.2 The ifStatement 207
The if-elseStatement 209
Using Block Statements 212
The Conditional Operator 217
Nested ifStatements 218
CONTENTS xxiii
5.3 Comparing Data 220
Comparing Floats 220
Comparing Characters 221
Comparing Objects 222
5.4 The switchStatement 223
5.5 The whileStatement 227
Infinite Loops 232
Nested Loops 234
Other Loop Controls 237
5.6 Iterators 238
Reading Text Files 239
5.7 The doStatement 242
5.8 The forStatement 245
Iterators and forLoops 249
Comparing Loops 251
5.9 Drawing with Loops and Conditionals 251
5.10 Determining Event Sources 254
5.11 Dialog Boxes 260
5.12 More Button Components 263
Check Boxes 264
Radio Buttons 267
xxiv CONTENTS
Chapter 6 Object-Oriented Design 287
6.1 Software Development Activities 288
6.2 Identifying Classes and Objects 289
Assigning Responsibilities 291
6.3 Static Class Members 291
Static Variables 292
Static Methods 292
6.4 Class Relationships 296
Dependency 296
Dependencies Among Objects of the Same Class 296
Aggregation 303
The thisReference 305
6.5 Interfaces 309
The Comparable Interface 315
The IteratorInterface 316
6.6 Enumerated Types Revisited 316
6.7 Method Design 319
Method Decomposition 320
Method Parameters Revisited 325
6.8 Method Overloading 328
6.9 Testing 333
Reviews 334
Defect Testing 334
6.10 GUI Design 336
CONTENTS xxv
6.11 Layout Managers 337
Flow Layout 339
Border Layout 344
Grid Layout 348
Box Layout 350
6.12 Borders 354
6.13 Containment Hierarchies 358
Chapter 7 Arrays 369
7.1 Array Elements 370
7.2 Declaring and Using Arrays 371
Bounds Checking 373
Alternate Array Syntax 379
Initializer Lists 379
Arrays as Parameters 380
7.3 Arrays of Objects 381
7.4 Command-Line Arguments 392
7.5 Variable Length Parameter Lists 394
7.6 Two-Dimensional Arrays 398
Multidimensional Arrays 402
7.7 The ArrayListClass 403
Specifying an ArrayList Element Type 404
ArrayListEfficiency 406
7.8 Polygons and Polylines 407
The PolygonClass 408
xxvi CONTENTS
7.9 Mouse Events 412
7.10 Key Events 420
Chapter 8 Inheritance 437
8.1 Creating Subclasses 438
The protectedModifier 443
The superReference 444
Multiple Inheritance 448
8.2 Overriding Methods 449
Shadowing Variables 451
8.3 Class Hierarchies 452
The ObjectClass 454
Abstract Classes 455
Interface Hierarchies 457
8.4 Visibility 458
8.5 Designing for Inheritance 461
Restricting Inheritance 462
8.6 The Component Class Hierarchy 463
8.7 Extending Adapter Classes 465
8.8 The TimerClass 469
CONTENTS xxvii
Chapter 9 Polymorphism 481
9.1 Late Binding 482
9.2 Polymorphism via Inheritance 483
9.3 Polymorphism via Interfaces 496
9.4 Sorting 498
Selection Sort 498
Insertion Sort 505
Comparing Sorts 506
9.5 Searching 507
Linear Search 507
Binary Search 511
Comparing Searches 513
9.6 Designing for Polymorphism 513
9.7 Event Processing 514
9.8 File Choosers 515
9.9 Color Choosers 518
9.10 Sliders 521
Chapter 10 Exceptions 531
10.1 Exception Handling 532
10.2 Uncaught Exceptions 533
10.3 The try-catchStatement 534
The finallyClause 537
xxviii CONTENTS
10.4 Exception Propagation 538
10.5 The Exception Class Hierarchy 541
Checked and Unchecked Exceptions 544
10.6 I/O Exceptions 545
10.7 Tool Tips and Mnemonics 549
10.8 Combo Boxes 556
10.9 Scroll Panes 562
10.10 Split Panes 564
Chapter 11 Recursion 575
11.1 Recursive Thinking 576
Infinite Recursion 577
Recursion in Math 577
11.2 Recursive Programming 578
Recursion vs. Iteration 581
Direct vs. Indirect Recursion 581
11.3 Using Recursion 582
Traversing a Maze 582
The Towers of Hanoi 588
11.4 Recursion in Graphics 593
Tiled Pictures 593
Fractals 596
CONTENTS xxix
Chapter 12 Collections 611
12.1 Collections and Data Structures 612
Separating Interface from Implementation 612
12.2 Dynamic Representations 613
Dynamic Structures 613
A Dynamically Linked List 614
Other Dynamic List Representations 619
12.3 Linear Data Structures 621
Queues 621
Stacks 622
12.4 Non-Linear Data Structures 624
Trees 625
Graphs 626
12.5 The C# Collections API 628
Generics 628
Appendix A Glossary 639
Appendix B Number Systems 665
Appendix C The Unicode Character Set 673
Appendix D C# Operators 677
Appendix E C# Modifiers 683
Appendix F C# Coding Guidelines 687
Appendix G C# Applets 693
xxx CONTENTS
Appendix H Regular Expressions 695
Appendix I C#Doc 697
Appendix J The PaintBox Project 703
Appendix K GUI Events 715
Appendix L C# Syntax 719
Appendix M The C# Class Library 733
Index 893

Library of Congress Subject Headings for this publication:

C# (Computer program language).
Computer software -- Development.