Java How to Program, Fifth Edition / Edition 5

Java How to Program, Fifth Edition / Edition 5

by Harvey M. Deitel, Paul J. Deitel, Paul J. Deitel

ISBN-10: 0131016210

ISBN-13: 9780131016217

Pub. Date: 12/20/2002

Publisher: Pearson

The Deitels' best-selling introductory Java book has been fully revised and updated to Java 2 Standard Edition (J2SE) 1.4. Like every How to Program book, "Java How to Program, Fifth Edition" features the Deitels' signature "LIVE-CODE" ™ approach to teaching programming languages with thousands of lines of live code, explained with exceptional


The Deitels' best-selling introductory Java book has been fully revised and updated to Java 2 Standard Edition (J2SE) 1.4. Like every How to Program book, "Java How to Program, Fifth Edition" features the Deitels' signature "LIVE-CODE" ™ approach to teaching programming languages with thousands of lines of live code, explained with exceptional clarity by the renowned programming trainers at Deitel and Associates. The Deitels cover all facets of the Java language, including object-orientation, multithreading, exception handling, the Java event programming model, GUI with Swing and AWT, graphics, and much more. You'll also find a set of core design patterns that are integrated throughout the text along with all new coverage of JDBC, SQL, n-tier, Web-application development with servlets and JSP, plus an introduction to XML processing with the Java XML library. The book also provides an optional, start-to-finish case study introducing Java object-oriented analysis and design with UML. It contains hundreds of tips, recommended practices and cautions (all marked with icons) for writing code that is portable, reusable and optimized for performance. For all beginning programmers — and developers experienced with traditional languages — who want to master Java quickly.

Product Details

Publication date:
How to Program Series
Edition description:
Older Edition
Product dimensions:
6.92(w) x 9.12(h) x 1.93(d)

Table of Contents

(NOTE: Each chapter begins with an Introduction.)
1. Introduction to Computers, the Internet and the Web.

What Is a Computer? Computer Organization. Evolution of Operating Systems. Personal, Distributed and Client/Server Computing. Machine Languages, Assembly Languages and High-Level Languages. History of C++. History of Java. Java Class Libraries. Other High-Level Languages. Structured Programming. The Internet and the World Wide Web. Basics of a Typical Java Environment. General Notes about Java and This Book. Thinking about Objects: Introduction to Object Technology and the Unified Modeling Language. Discovering Design Patterns: Introduction. Tour of the Book. (Optional) A Tour of the Case Study on Object-Oriented Design with the UML. (Optional) A Tour of the “Discovering Design Patterns” Sections.

2. Introduction to Java Applications.
A First Program in Java: Printing a Line of Text. Modifying Our First Java Program. Displaying Text in a Dialog Box. Another Java Application: Adding Integers. Memory Concepts. Arithmetic. Decision Making: Equality and Relational Operators. (Optional Case Study) Thinking about Objects: Examining the Problem Statement.

3. Introduction to Java Applets.
Sample Applets from the Java 2 Software Development Kit. A Simple Java Applet: Drawing a String. Two More Simple Applets: Drawing Strings and Lines. Another Java Applet: Adding Floating-Point Numbers. Viewing Applets in a Web Browser. Java Applet Internet andWorld Wide Web Resources. (Optional Case Study) Thinking about Objects: Identifying the Classes in a Problem Statement.

4. Control Structures: Part 1.
Algorithms. Pseudocode. Control Structures. The if Selection Structure. The if/else Selection Structure. The while Repetition Structure. Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition). Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition). Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures). Assignment Operators. Increment and Decrement Operators. Primitive Data Types. (Optional Case Study) Thinking about Objects: Identifying Class Attributes.

5. Control Structures: Part 2.
Essentials of Counter-Controlled Repetition. The for Repetition Structure. Examples Using the for Structure. The switch Multiple-Selection Structure. The do/while Repetition Structure. Statements break and continue. Labeled break and continue Statements. Logical Operators. Structured Programming Summary. (Optional Case Study) Thinking about Objects: Identifying Objects' States and Activities.

6. Methods.
Program Modules in Java. Math Class Methods. Methods. Method Definitions. Argument Promotion. Java API Packages. Random-Number Generation. Example: A Game of Chance. Duration of Identifiers. Scope Rules. Recursion. Example Using Recursion: The Fibonacci Series. Recursion vs. Iteration. Method Overloading. Methods of Class JApplet. (Optional Case Study) Thinking about Objects: Identifying Class Operations.

7. Arrays.
Arrays. Declaring and Allocating Arrays. Examples Using Arrays. References and Reference Parameters. Passing Arrays to Methods. Sorting Arrays. Searching Arrays: Linear Search and Binary Search. Multiple-Subscripted Arrays. (Optional Case Study) Thinking about Objects: Collaboration among Objects.

8. Object-Based Programming.
Implementing a Time Abstract Data Type with a Class. Class Scope. Controlling Access to Members. Creating Packages. Initializing Class Objects: Constructors. Using Overloaded Constructors. Using Set and Get Methods. Software Reusability. Final Instance Variables. Composition: Objects as Instance Variables of Other Classes. Package Access. Using the this Reference. Finalizers. Static Class Members. Data Abstraction and Encapsulation. (Optional Case Study) Thinking about Objects: Starting to Program the Classes for the Elevator Simulation.

9. Object-Oriented Programming.
Superclasses and Subclasses. Protected Members. Relationship between Superclass Objects and Subclass Objects. Constructors and Finalizers in Subclasses. Implicit Subclass-Object-to-Superclass-Object Conversion. Software Engineering with Inheritance. Composition vs. Inheritance. Case Study: Point, Circle, Cylinder. Introduction to Polymorphism. Type Fields and switch Statements. Dynamic Method Binding. final Methods and Classes. Abstract Superclasses and Concrete Classes. Polymorphism Examples. Case Study: A Payroll System Using Polymorphism. New Classes and Dynamic Binding. Case Study: Inheriting Interface and Implementation. Case Study: Creating and Using Interfaces. Inner Class Definitions. Notes on Inner Class Definitions. Type-Wrapper Classes for Primitive Types. (Optional Case Study) Thinking about Objects: Incorporating Inheritance into the Elevator Simulation. (Optional) Discovering Design Patterns: Introducing Creational, Structural and Behavioral Design Patterns.

10. Strings and Characters.
Fundamentals of Characters and Strings. String Constructors. String Methods length, charAt and getChars. Comparing Strings. String Method hashCode. Locating Characters and Substrings in Strings. Extracting Substrings from Strings. Concatenating Strings. Miscellaneous String Methods. Using String Method valueOf. String Method intern. StringBuffer Class. StringBuffer Constructors. StringBuffer Methods length, capacity, setLength and ensureCapacity. StringBuffer Methods charAt, setCharAt, getChars and reverse. StringBuffer append Methods. StringBuffer Insertion and Deletion Methods. Character Class Examples. Class StringTokenizer. Card Shuffling and Dealing Simulation. (Optional Case Study) Thinking about Objects: Event Handling.

11. Graphics and Java2D.
Graphics Contexts and Graphics Objects. Color Control. Font Control. Drawing Lines, Rectangles and Ovals. Drawing Arcs. Drawing Polygons and Polylines. The Java2D API. Java2D Shapes. (Optional Case Study) Thinking about Objects: Designing Interfaces with the UML.

12. Graphical User Interface Components: Part 1.
Swing Overview. JLabel. Event-Handling Model. JTextField and JPasswordField. JButton. JCheckBox and JRadioButton. JComboBox. JList. Multiple-Selection Lists. Mouse Event Handling. Adapter Classes. Keyboard Event Handling. Layout Managers. Panels. (Optional Case Study) Thinking about Objects: Use Cases.

13. Graphical User Interface Components: Part 2.
JTextArea. Creating a Customized Subclass of JPanel. Creating a Self-Contained Subclass of JPanel. JSlider. Windows. Designing Programs that Execute as Applets or Applications. Using Menus with Frames. Using JPopupMenus. Pluggable Look-and-Feel. Using JDesktopPane and JInternalFrame. Layout Managers. BoxLayout Layout Manager. CardLayout Layout Manager. GridBagLayout Layout Manager. GridBagConstraints Constants RELATIVE and REMAINDER. (Optional Case Study) Thinking about Objects: Model-View-Controller. (Optional) Discovering Design Patterns: Design Patterns Used in Packages java.awt and javax.swing.

14. Exception Handling.
When Exception Handling Should Be Used. Other Error-Handling Techniques. Basics of Java Exception Handling. try Blocks. Throwing an Exception. Catching an Exception. Exception-Handling Example: Divide by Zero. Rethrowing an Exception. throws Clause. Constructors, Finalizers and Exception Handling. Exceptions and Inheritance. finally Block. Using printStackTrace and getMessage.

15. Multithreading.
Class Thread: An Overview of the Thread Methods. Thread States: Life Cycle of a Thread. Thread Priorities and Thread Scheduling. Thread Synchronization. Producer/Consumer Relationship without Thread Synchronization. Producer/Consumer Relationship with Thread Synchronization. Producer/Consumer Relationship: The Circular Buffer. Daemon Threads. Runnable Interface. Thread Groups. (Optional Case Study) Thinking about Objects: Multithreading. (Optional) Discovering Design Patterns: Concurrent Design Patterns.

16. Files and Streams.
Data Hierarchy. Files and Streams. Creating a Sequential-Access File. Reading Data from a Sequential-Access File. Updating Sequential-Access Files. Random-Access Files. Creating a Random-Access File. Writing Data Randomly to a Random-Access File. Reading Data Sequentially from a Random-Access File. Example: A Transaction-Processing Program. Class File.

17. Networking.
Manipulating URIs. Reading a File on a Web Server. Establishing a Simple Server Using Stream Sockets. Establishing a Simple Client Using Stream Sockets. Client/Server Interaction with Stream Socket Connections. Connectionless Client/Server Interaction with Datagrams. Client/Server Tic-Tac-Toe Using a Multithreaded Server. Security and the Network. DeitelMessenger Chat Server and Client. (Optional) Discovering Design Patterns: Design Patterns Used in Packages and

18. Multimedia: Images, Animation, Audio and Video.
Loading, Displaying and Scaling Images. Animating a Series of Images. Customizing LogoAnimator via Applet Parameters. Image Maps. Loading and Playing Audio Clips. Internet and World Wide Web Resources.

19. Data Structures.
Self-Referential Classes. Dynamic Memory Allocation. Linked Lists. Stacks. Queues. Trees.

20. Java Utilities Package and Bit Manipulation.
Vector Class and Enumeration Interface. Stack Class. Dictionary Class. Hashtable Class. Properties Class. Random Class. Bit Manipulation and the Bitwise Operators. BitSet Class.

21. Collections.
Collections Overview. Class Arrays. Interface Collection and Class Collections. Lists. Algorithms. Sets. Maps. Synchronization Wrappers. Unmodifiable Wrappers. Abstract Implementations. (Optional) Discovering Design Patterns: Design Patterns Used in Package java.util.

22. Java Database Connectivity (JDBC).
Relational-Database Model. Relational Database Overview: The books Database. Structured Query Language (SQL). Creating Database books in Cloudscape. Manipulating Databases with JDBC. Case Study: Address-Book Application. Stored Procedures. Batch Processing. Processing Multiple ResultSets or Update Counts. Updatable ResultSets. JDBC 2.0 Optional Package javax.sql. Internet and World Wide Web Resources.

23. Servlets.
Servlet Overview and Architecture. Handling HTTP get Requests. Handling HTTP get Requests Containing Data. Handling HTTP post Requests. Redirecting Requests to Other Resources. Session Tracking. Multi-Tier Applications: Using JDBC from a Servlet. HttpUtils Class. Internet and World Wide Web Resources.

24. JavaServer Pages™ (JSP).
JavaServer Pages Overview. A First JavaServer Page Example. Implicit Objects. Scripting. Standard Actions. Directives. Custom Tag Libraries. Internet and World Wide Web Resources.


A. Java Demos.
Introduction. The Sites.

B. Java Resources.
Resources. Products. FAQs. Tutorials. Magazines. Java Applets. Multimedia. Newsgroups.

C. Operator Precedence Chart.
D. ASCII Character Set.
E. Number Systems (on CD).
Introduction. Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers. Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers. Converting from Binary, Octal, or Hexadecimal to Decimal. Converting from Decimal to Binary, Octal, or Hexadecimal. Negative Binary Numbers: Two's Complement Notation.

F. Creating HTML Documentation with javadoc (on CD).
Introduction. Documentation Comments. Documenting Java Source Code. javadoc. Files Produced by javadoc.

G. Elevator Events and Listener Interfaces (on CD).
Introduction. Events. Listeners. Component Diagrams Revisited.

H. Elevator Model (on CD).
Introduction. Class ElevatorModel. Classes Location and Floor. Class Door. Class Button. Class ElevatorShaft. Classes Light and Bell. Class Elevator. Class Person. Component Diagrams Revisited. Conclusion.

I. Elevator View (on CD).
Introduction. Class Objects. Class Constants. Class constructor. Event Handling. Component Diagrams Revisited. Conclusion.

J. Career Opportunities (on CD).
Introduction. Resources for the Job Seeker. Online Opportunities for Employers. Recruiting Services. Career Sites. Internet and World Wide Web Resources.

K. Unicode® (on CD).
Introduction. Unicode Transformation Formats. Characters and Glyphs. Advantages/Disadvantages of Unicode. Unicode Consortium's Web Site. Using Unicode. Character Ranges.


Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >