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.
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.
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.
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.
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 java.io and java.net.
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.
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.
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.