Java Software Solutions: Foundations of Program Design / Edition 5

Java Software Solutions: Foundations of Program Design / Edition 5

by William Loftus, William Loftus
     
 

View All Available Formats & Editions

ISBN-10: 0321409493

ISBN-13: 9780321409492

Pub. Date: 02/15/2006

Publisher: Addison Wesley

Lewis and Loftus helped transform introductory programming courses when they published the worldwide best-selling Java Software Solutions, the first book written from the ground-up specifically for such a course using Java. With this Fourth Edition, John Lewis and William Loftus remain on the leading edge of computer science education by making enhancements relevant

Overview

Lewis and Loftus helped transform introductory programming courses when they published the worldwide best-selling Java Software Solutions, the first book written from the ground-up specifically for such a course using Java. With this Fourth Edition, John Lewis and William Loftus remain on the leading edge of computer science education by making enhancements relevant to today's introductory Java students.

Product Details

ISBN-13:
9780321409492
Publisher:
Addison Wesley
Publication date:
02/15/2006
Edition description:
Older Edition
Pages:
784
Product dimensions:
7.32(w) x 9.02(h) x 1.15(d)

Table of Contents

Prefacevii
Chapter 1Introduction1
1.1Computer Processing2
Software Categories3
Digital Computers5
Binary Numbers7
1.2Hardware Components10
Computer Architecture10
Input/Output Devices12
Main Memory and Secondary Memory13
The Central Processing Unit17
1.3Networks19
Network Connections19
Local-Area Networks and Wide-Area Networks21
The Internet22
The World Wide Web24
Uniform Resource Locators25
1.4The Java Programming Language26
A Java Program27
Comments29
Identifiers and Reserved Words31
White Space33
1.5Program Development35
Programming Language Levels36
Editors, Compilers, and Interpreters38
Development Environments40
Syntax and Semantics41
Errors42
1.6Object-Oriented Programming43
Problem Solving44
Object-Oriented Software Principles45
Chapter 2Data and Expressions61
2.1Character Strings62
The print and println Methods62
String Concatenation64
Escape Sequences66
2.2Variables and Assignment69
Variables69
The Assignment Statement71
Constants73
2.3Primitive Data Types73
Integers and Floating Points74
Characters75
Booleans77
2.4Expressions77
Arithmetic Operators78
Operator Precedence78
Increment and Decrement Operators83
Assignment Operators84
2.5Data Conversion85
Conversion Techniques87
2.6Interactive Programs88
The Scanner Class88
2.7Graphics93
Coordinate Systems94
Representing Color95
2.8Applets96
Executing Applets Using the Web98
2.9Drawing Shapes99
The Graphics Class99
Chapter 3Using Classes and Objects113
3.1Creating Objects114
Aliases116
3.2The String Class118
3.3Packages121
The import Declaration122
3.4The Random Class124
3.5The Math Class127
3.6Formatting Output130
The NumberFormat Class130
The DecimalFormat Class133
The printf Method135
3.7Enumerated Types135
3.8Wrapper Classes138
Autoboxing141
3.9Components and Containers141
Frames and Panels142
3.10Nested Panels145
3.11Images148
Chapter 4Writing Classes155
4.1Anatomy of a Class156
Instance Data161
UML Class Diagrams162
4.2Encapsulation163
Visibility Modifiers164
Accessors and Mutators165
4.3Anatomy of a Method166
The return Statement167
Parameters169
Local Data170
Bank Account Example171
4.4Constructors Revisited175
4.5Graphical Objects175
4.6Graphical User Interfaces184
4.7Buttons185
4.8Text Fields189
Chapter 5Conditionals and Loops201
5.1Boolean Expressions202
Equality and Relational Operators203
Logical Operators204
5.2The if Statement207
The if-else Statement209
Using Block Statements212
The Conditional Operator217
Nested if Statements218
5.3Comparing Data220
Comparing Floats220
Comparing Characters221
Comparing Objects222
5.4The switch Statement223
5.5The while Statement227
Infinite Loops232
Nested Loops234
Other Loop Controls237
5.6Iterators238
Reading Text Files239
5.7The do Statement242
5.8The for Statement245
Iterators and for Loops249
Comparing Loops251
5.9Drawing with Loops and Conditionals251
5.10Determining Event Sources254
5.11Dialog Boxes260
5.12More Button Components263
Check Boxes264
Radio Buttons267
Chapter 6Object-Oriented Design287
6.1Software Development Activities288
6.2Identifying Classes and Objects289
Assigning Responsibilities291
6.3Static Class Members291
Static Variables292
Static Methods292
6.4Class Relationships296
Dependency296
Dependencies Among Objects of the Same Class296
Aggregation303
The this Reference305
6.5Interfaces309
The Comparable Interface315
The Iterator Interface316
6.6Enumerated Types Revisited316
6.7Method Design319
Method Decomposition320
Method Parameters Revisited325
6.8Method Overloading328
6.9Testing333
Reviews334
Defect Testing334
6.10GUI Design336
6.11Layout Managers337
Flow Layout339
Border Layout344
Grid Layout348
Box Layout350
6.12Borders354
6.13Containment Hierarchies358
Chapter 7Arrays369
7.1Array Elements370
7.2Declaring and Using Arrays371
Bounds Checking373
Alternate Array Syntax379
Initializer Lists379
Arrays as Parameters380
7.3Arrays of Objects381
7.4Command-Line Arguments392
7.5Variable Length Parameter Lists394
7.6Two-Dimensional Arrays398
Multidimensional Arrays402
7.7The ArrayList Class403
Specifying an ArrayList Element Type404
ArrayList Efficiency406
7.8Polygons and Polylines407
The Polygon Class408
7.9Mouse Events412
7.10Key Events420
Chapter 8Inheritance437
8.1Creating Subclasses438
The protected Modifier443
The super Reference444
Multiple Inheritance448
8.2Overriding Methods449
Shadowing Variables451
8.3Class Hierarchies452
The Object Class454
Abstract Classes455
Interface Hierarchies457
8.4Visibility458
8.5Designing for Inheritance461
Restricting Inheritance462
8.6The Component Class Hierarchy463
8.7Extending Adapter Classes465
8.8The Timer Class469
Chapter 9Polymorphism481
9.1Late Binding482
9.2Polymorphism via Inheritance483
9.3Polymorphism via Interfaces496
9.4Sorting498
Selection Sort498
Insertion Sort505
Comparing Sorts506
9.5Searching507
Linear Search507
Binary Search511
Comparing Searches513
9.6Designing for Polymorphism513
9.7Event Processing514
9.8File Choosers515
9.9Color Choosers518
9.10Sliders521
Chapter 10Exceptions531
10.1Exception Handling532
10.2Uncaught Exceptions533
10.3The try-catch Statement534
The finally Clause537
10.4Exception Propagation538
10.5The Exception Class Hierarchy541
Checked and Unchecked Exceptions544
10.6I/O Exceptions545
10.7Tool Tips and Mnemonics549
10.8Combo Boxes556
10.9Scroll Panes562
10.10Split Panes564
Chapter 11Recursion575
11.1Recursive Thinking576
Infinite Recursion577
Recursion in Math577
11.2Recursive Programming578
Recursion vs. Iteration581
Direct vs. Indirect Recursion581
11.3Using Recursion582
Traversing a Maze582
The Towers of Hanoi588
11.4Recursion in Graphics593
Tiled Pictures593
Fractals596
Chapter 12Collections611
12.1Collections and Data Structures612
Separating Interface from Implementation612
12.2Dynamic Representations613
Dynamic Structures613
A Dynamically Linked List614
Other Dynamic List Representations619
12.3Linear Data Structures621
Queues621
Stacks622
12.4Non-Linear Data Structures624
Trees625
Graphs626
12.5The Java Collections API628
Generics628
Appendix AGlossary639
Appendix BNumber Systems665
Appendix CThe Unicode Character Set673
Appendix DJava Operators677
Appendix EJava Modifiers683
Appendix FJava Coding Guidelines687
Appendix GJava Applets693
Appendix HRegular Expressions695
Appendix IJavaDoc697
Appendix JThe PaintBox Project703
Appendix KGUI Events715
Appendix LJava Syntax719
Appendix MThe Java Class Library733
Index893

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >