Embracing in full the new features of the Java 2 platform as they apply to CS1/Introductory Programming topics, the second edition of this leading textbook continues to teach beginning programmers how to design and implement high-quality object-oriented software. A new chapter, "Exceptions and I/O Streams" (Chapter 8), has been added, which explains the Keyboard class used in the text and explores other I/O issues such as files, network communication, and object serialization. Applets and applications are intertwined throughout the book to demonstrate computing concepts. Applets, introduced in Chapter 2, build on the excitement of the Web, while applications allow students to gain a clear understanding of programming concepts. John Lewis and William Loftus have expanded their coverage of lasses and objects with this edition to provide more in-depth discussion of methods and parameter passing, object relationships, and class design. Discussion of Swing components is also new to this edition, as is the inclusion of new Collection classes.
FEATURES *Provides an object-oriented approach to Introductory Programming (Chapters 2 and 3 introduce object concepts; Chapter 4 and beyond show how to design and implement classes) *New chapter on I/O familiarizes students with the different facets of user interaction *The new, optional Graphics Track throughout the text reinforces the primary themes of each chapter by using graphical examples and discussing new graphics material *New syntax boxes highlight Java language elements with syntax diagrams, short descriptions, and concise examples *Web Bonus sections highlight extra information about various CS1 topics that can be found on the World Wide Web *NEWNow includes a CD-ROM containing Java development tools, as well as source code and PowerPoint slides from the text
Table of Contents:
1. Computer Systems.
Introduction.
Hardware Components.
Networks.
Programming.
Programming Languages.
Graphics.
2. Objects and Primitive Data.
Introduction to Objects.
String Literals.
Variables and Assignments.
Primitive Data Types and Expressions.
Creating Objects.
Class Libraries and Packages.
Invoking Class Methods.
Formatting Output.
An Introduction to Applets.
Drawing Shapes.
3. Program Statements.
Control Flow.
The if Statement.
The switch Statement.
Boolean Expressions Revisited.
More Operators.
The while Statement.
The do Statement.
The for Statement.
Developing Programs.
Drawing using Conditionals and Loops.
4. Writing Classes.
Objects Revisited.
Anatomy of a Class.
Anatomy of a Method.
Object Relationships.
Method Overloading.
Method Decomposition.
Applet Methods.
Graphical Objects.
5. Enhancing Classes.
References Revisited.
The static Modifier.
Nested Classes.
Interfaces.
Events and Listeners.
Animations.
6. Arrays and Vectors.
Arrays.
Arrays of Objects.
Sorting.
Two-Dimensional Arrays.
The Vector Class.
Arrays and Graphics.
7. Inheritance.
Creating Subclasses.
Overriding Methods.
Class Hierarchies.
Polymorphism via Inheritance.
Indirect Use of Noninherited Members.
Interface Hierarchies.
Inheritance and Graphics.
GUI Components.
8. Exceptions and I/O Streams.
Exceptions.
Input/Output Streams.
Standard I/O.
Text Files.
Object Serialization.
9. Graphical User Interfaces.
Java GUI Overview.
Containers.
Components.
Layout Managers.
Special Features.
GUI Design.
10. Software Engineering.
Software Development Models.
Prototypes.
Testing.
Evolutionary Development.
The PaintBox Project.
11. Recursion.
Recursive Thinking.
Recursive Programming.
Using Recursion.
Recursion in Graphics.
12. Data Structures.
Collections.
Implementing Data Structures.
Classic Data Structures.
Collection Classes.
Appendix A. Glossary.
Appendix B. Number Systems.
Appendix C. The Unicode Character Set.
Appendix D. Java Operators.
Appendix E. Java Bitwise Operators.
Appendix F. Java Modifiers.
Appendix G. Java Coding Guidelines.
Appendix H. Review Checklist.
Appendix I. Comparing Java to C++.
Appendix J. An HTML Tutorial.
Appendix K. Java Exceptions and Errors.
Appendix L. Java Syntax.
Appendix M. The Java Class Library.
Index.