You are previewing Java: The Complete Reference™, Eighth Edition.
O'Reilly logo
Java: The Complete Reference™, Eighth Edition

Book Description

The Definitive Java Programming Guide In Java: The Complete Reference, Eighth Edition, best selling programming author Herb Schildt shows you everything you need to develop, compile, debug, and run Java programs. Updated for Java Platform, Standard Edition 7 (Java SE 7), this comprehensive volume covers the entire Java language, including its syntax, keywords, and fundamental programming principles.

Table of Contents

  1. Cover Page
  2. Java: The Complete Reference™
  3. Copyright Page
  4. About the Author
  5. Contents at a Glance
  6. Contents
  7. Preface
  8. PART I The Java Language
    1. CHAPTER 1 The History and Evolution of Java
      1. Java’s Lineage
        1. The Birth of Modern Programming: C
        2. C++: The Next Step
        3. The Stage Is Set for Java
      2. The Creation of Java
        1. The C# Connection
      3. How Java Changed the Internet
        1. Java Applets
        2. Security
        3. Portability
      4. Java’s Magic: The Bytecode
      5. Servlets: Java on the Server Side
      6. The Java Buzzwords
        1. Simple
        2. Object-Oriented
        3. Robust
        4. Multithreaded
        5. Architecture-Neutral
        6. Interpreted and High Performance
        7. Distributed
        8. Dynamic
      7. The Evolution of Java
        1. Java SE 7
      8. A Culture of Innovation
    2. CHAPTER 2 An Overview of Java
      1. Object-Oriented Programming
        1. Two Paradigms
        2. Abstraction
        3. The Three OOP Principles
      2. A First Simple Program
        1. Entering the Program
        2. Compiling the Program
        3. A Closer Look at the First Sample Program
      3. A Second Short Program
      4. Two Control Statements
        1. The if Statement
        2. The for Loop
      5. Using Blocks of Code
      6. Lexical Issues
        1. Whitespace
        2. Identifiers
        3. Literals
        4. Comments
        5. Separators
        6. The Java Keywords
      7. The Java Class Libraries
    3. CHAPTER 3 Data Types, Variables, and Arrays
      1. Java Is a Strongly Typed Language
      2. The Primitive Types
      3. Integers
        1. byte
        2. short
        3. int
        4. long
      4. Floating-Point Types
        1. float
        2. double
      5. Characters
      6. Booleans
      7. A Closer Look at Literals
        1. Integer Literals
        2. Floating-Point Literals
        3. Boolean Literals
        4. Character Literals
        5. String Literals
      8. Variables
        1. Declaring a Variable
        2. Dynamic Initialization
        3. The Scope and Lifetime of Variables
      9. Type Conversion and Casting
        1. Java’s Automatic Conversions
        2. Casting Incompatible Types
      10. Automatic Type Promotion in Expressions
        1. The Type Promotion Rules
      11. Arrays
        1. One-Dimensional Arrays
        2. Multidimensional Arrays
        3. Alternative Array Declaration Syntax
      12. A Few Words About Strings
      13. A Note to C/C++ Programmers About Pointers
    4. CHAPTER 4 Operators
      1. Arithmetic Operators
        1. The Basic Arithmetic Operators
        2. The Modulus Operator
        3. Arithmetic Compound Assignment Operators
        4. Increment and Decrement
      2. The Bitwise Operators
        1. The Bitwise Logical Operators
        2. The Left Shift
        3. The Right Shift
        4. The Unsigned Right Shift
        5. Bitwise Operator Compound Assignments
      3. Relational Operators
      4. Boolean Logical Operators
        1. Short-Circuit Logical Operators
      5. The Assignment Operator
      6. The ? Operator
      7. Operator Precedence
      8. Using Parentheses
    5. CHAPTER 5 Control Statements
      1. Java’s Selection Statements
        1. if
        2. switch
      2. Iteration Statements
        1. while
        2. do-while
        3. for
        4. The For-Each Version of the for Loop
        5. Nested Loops
      3. Jump Statements
        1. Using break
        2. Using continue
    6. CHAPTER 6 Introducing Classes
      1. Class Fundamentals
        1. The General Form of a Class
        2. A Simple Class
      2. Declaring Objects
        1. A Closer Look at new
      3. Assigning Object Reference Variables
      4. Introducing Methods
        1. Adding a Method to the Box Class
        2. Returning a Value
        3. Adding a Method That Takes Parameters
      5. Constructors
        1. Parameterized Constructors
      6. The this Keyword
        1. Instance Variable Hiding
      7. Garbage Collection
      8. The finalize( ) Method
      9. A Stack Class
    7. CHAPTER 7 A Closer Look at Methods and Classes
      1. Overloading Methods
        1. Overloading Constructors
      2. Using Objects as Parameters
      3. A Closer Look at Argument Passing
      4. Returning Objects
      5. Recursion
      6. Introducing Access Control
      7. Understanding static
      8. Introducing final
      9. Arrays Revisited
      10. Introducing Nested and Inner Classes
      11. Exploring the String Class
      12. Using Command-Line Arguments
      13. Varargs: Variable-Length Arguments
        1. Overloading Vararg Methods
        2. Varargs and Ambiguity
    8. CHAPTER 8 Inheritance
      1. Inheritance Basics
        1. Member Access and Inheritance
        2. A More Practical Example
        3. A Superclass Variable Can Reference a Subclass Object
      2. Using super
        1. Using super to Call Superclass Constructors
        2. A Second Use for super
      3. Creating a Multilevel Hierarchy
      4. When Constructors Are Called
      5. Method Overriding
      6. Dynamic Method Dispatch
        1. Why Overridden Methods?
        2. Applying Method Overriding
      7. Using Abstract Classes
      8. Using final with Inheritance
        1. Using final to Prevent Overriding
        2. Using final to Prevent Inheritance
      9. The Object Class
    9. CHAPTER 9 Packages and Interfaces
      1. Packages
        1. Defining a Package
        2. Finding Packages and CLASSPATH
        3. A Short Package Example
      2. Access Protection
        1. An Access Example
      3. Importing Packages
      4. Interfaces
        1. Defining an Interface
        2. Implementing Interfaces
        3. Nested Interfaces
        4. Applying Interfaces
        5. Variables in Interfaces
        6. Interfaces Can Be Extended
    10. CHAPTER 10 Exception Handling
      1. Exception-Handling Fundamentals
      2. Exception Types
      3. Uncaught Exceptions
      4. Using try and catch
        1. Displaying a Description of an Exception
      5. Multiple catch Clauses
      6. Nested try Statements
      7. throw
      8. throws
      9. finally
      10. Java’s Built-in Exceptions
      11. Creating Your Own Exception Subclasses
      12. Chained Exceptions
      13. Three New JDK 7 Exception Features
      14. Using Exceptions
    11. CHAPTER 11 Multithreaded Programming
      1. The Java Thread Model
        1. Thread Priorities
        2. Synchronization
        3. Messaging
        4. The Thread Class and the Runnable Interface
      2. The Main Thread
      3. Creating a Thread
        1. Implementing Runnable
        2. Extending Thread
        3. Choosing an Approach
      4. Creating Multiple Threads
      5. Using isAlive( ) and join( )
      6. Thread Priorities
      7. Synchronization
        1. Using Synchronized Methods
        2. The synchronized Statement
      8. Interthread Communication
        1. Deadlock
      9. Suspending, Resuming, and Stopping Threads
        1. Suspending, Resuming, and Stopping Threads Using Java 1.1 and Earlier
        2. The Modern Way of Suspending, Resuming, and Stopping Threads
      10. Obtaining A Thread’s State
      11. Using Multithreading
    12. CHAPTER 12 Enumerations, Autoboxing, and Annotations (Metadata)
      1. Enumerations
        1. Enumeration Fundamentals
        2. The values( ) and valueOf( ) Methods
        3. Java Enumerations Are Class Types
        4. Enumerations Inherit Enum
        5. Another Enumeration Example
      2. Type Wrappers
        1. Character
        2. Boolean
        3. The Numeric Type Wrappers
      3. Autoboxing
        1. Autoboxing and Methods
        2. Autoboxing/Unboxing Occurs in Expressions
        3. Autoboxing/Unboxing Boolean and Character Values
        4. Autoboxing/Unboxing Helps Prevent Errors
        5. A Word of Warning
      4. Annotations (Metadata)
        1. Annotation Basics
        2. Specifying a Retention Policy
        3. Obtaining Annotations at Run Time by Use of Reflection
        4. The AnnotatedElement Interface
        5. Using Default Values
        6. Marker Annotations
        7. Single-Member Annotations
        8. The Built-In Annotations
        9. Some Restrictions
    13. CHAPTER 13 I/O, Applets, and Other Topics
      1. I/O Basics
        1. Streams
        2. Byte Streams and Character Streams
        3. The Predefined Streams
      2. Reading Console Input
        1. Reading Characters
        2. Reading Strings
      3. Writing Console Output
      4. The PrintWriter Class
      5. Reading and Writing Files
      6. Automatically Closing a File
      7. Applet Fundamentals
      8. The transient and volatile Modifiers
      9. Using instanceof
      10. strictfp
      11. Native Methods
      12. Problems with Native Methods
      13. Using assert
        1. Assertion Enabling and Disabling Options
      14. Static Import
      15. Invoking Overloaded Constructors Through this( )
    14. CHAPTER 14 Generics
      1. What Are Generics?
      2. A Simple Generics Example
        1. Generics Work Only with Objects
        2. Generic Types Differ Based on Their Type Arguments
        3. How Generics Improve Type Safety
      3. A Generic Class with Two Type Parameters
      4. The General Form of a Generic Class
      5. Bounded Types
      6. Using Wildcard Arguments
        1. Bounded Wildcards
      7. Creating a Generic Method
        1. Generic Constructors
      8. Generic Interfaces
      9. Raw Types and Legacy Code
      10. Generic Class Hierarchies
        1. Using a Generic Superclass
        2. A Generic Subclass
        3. Run-Time Type Comparisons Within a Generic Hierarchy
        4. Casting
        5. Overriding Methods in a Generic Class
      11. Type Inference with Generics
      12. Erasure
        1. Bridge Methods
      13. Ambiguity Errors
      14. Some Generic Restrictions
        1. Type Parameters Can’t Be Instantiated
        2. Restrictions on Static Members
        3. Generic Array Restrictions
        4. Generic Exception Restriction
  9. PART II The Java Library
    1. CHAPTER 15 String Handling
      1. The String Constructors
      2. String Length
      3. Special String Operations
        1. String Literals
        2. String Concatenation
        3. String Concatenation with Other Data Types
        4. String Conversion and toString( )
      4. Character Extraction
        1. charAt( )
        2. getChars( )
        3. getBytes( )
        4. toCharArray( )
      5. String Comparison
        1. equals( ) and equalsIgnoreCase( )
        2. regionMatches( )
        3. startsWith( ) and endsWith( )
        4. equals( ) Versus ==
        5. compareTo( )
      6. Searching Strings
      7. Modifying a String
        1. substring( )
        2. concat( )
        3. replace( )
        4. trim( )
      8. Data Conversion Using valueOf( )
      9. Changing the Case of Characters Within a String
      10. Additional String Methods
      11. StringBuffer
        1. StringBuffer Constructors
        2. length( ) and capacity( )
        3. ensureCapacity( )
        4. setLength( )
        5. charAt( ) and setCharAt( )
        6. getChars( )
        7. append( )
        8. insert( )
        9. reverse( )
        10. delete( ) and deleteCharAt( )
        11. replace( )
        12. substring( )
        13. Additional StringBuffer Methods
      12. StringBuilder
    2. CHAPTER 16 Exploring java.lang
      1. Primitive Type Wrappers
        1. Number
        2. Double and Float
        3. Understanding isInfinite( ) and isNaN( )
        4. Byte, Short, Integer, and Long
        5. Character
        6. Additions to Character for Unicode Code Point Support
        7. Boolean
      2. Void
      3. Process
      4. Runtime
        1. Memory Management
        2. Executing Other Programs
      5. ProcessBuilder
      6. System
        1. Using currentTimeMillis( ) to Time Program Execution
        2. Using arraycopy( )
        3. Environment Properties
      7. Object
      8. Using clone( ) and the Cloneable Interface
      9. Class
      10. ClassLoader
      11. Math
        1. Trigonometric Functions
        2. Exponential Functions
        3. Rounding Functions
        4. Miscellaneous Math Methods
      12. StrictMath
      13. Compiler
      14. Thread, ThreadGroup, and Runnable
        1. The Runnable Interface
        2. Thread
        3. ThreadGroup
      15. ThreadLocal and InheritableThreadLocal
      16. Package
      17. RuntimePermission
      18. Throwable
      19. SecurityManager
      20. StackTraceElement
      21. Enum
      22. ClassValue
      23. The CharSequence Interface
      24. The Comparable Interface
      25. The Appendable Interface
      26. The Iterable Interface
      27. The Readable Interface
      28. The AutoCloseable Interface
      29. The Thread.UncaughtExceptionHandler Interface
      30. The java.lang Subpackages
        1. java.lang.annotation
        2. java.lang.instrument
        3. java.lang.invoke
        4. java.lang.management
        5. java.lang.ref
        6. java.lang.reflect
    3. CHAPTER 17 java.util Part 1: The Collections Framework
      1. Collections Overview
      2. JDK 5 Changed the Collections Framework
        1. Generics Fundamentally Changed the Collections Framework
        2. Autoboxing Facilitates the Use of Primitive Types
        3. The For-Each Style for Loop
      3. The Collection Interfaces
        1. The Collection Interface
        2. The List Interface
        3. The Set Interface
        4. The SortedSet Interface
        5. The NavigableSet Interface
        6. The Queue Interface
        7. The Deque Interface
      4. The Collection Classes
        1. The ArrayList Class
        2. The LinkedList Class
        3. The HashSet Class
        4. The LinkedHashSet Class
        5. The TreeSet Class
        6. The PriorityQueue Class
        7. The ArrayDeque Class
        8. The EnumSet Class
      5. Accessing a Collection via an Iterator
        1. Using an Iterator
        2. The For-Each Alternative to Iterators
      6. Storing User-Defined Classes in Collections
      7. The RandomAccess Interface
      8. Working with Maps
        1. The Map Interfaces
        2. The Map Classes
      9. Comparators
        1. Using a Comparator
      10. The Collection Algorithms
      11. Arrays
      12. Why Generic Collections?
      13. The Legacy Classes and Interfaces
        1. The Enumeration Interface
        2. Vector
        3. Stack
        4. Dictionary
        5. Hashtable
        6. Properties
        7. Using store( ) and load( )
      14. Parting Thoughts on Collections
    4. CHAPTER 18 java.util Part 2: More Utility Classes
      1. StringTokenizer
      2. BitSet
      3. Date
      4. Calendar
      5. GregorianCalendar
      6. TimeZone
      7. SimpleTimeZone
      8. Locale
      9. Random
      10. Observable
        1. The Observer Interface
        2. An Observer Example
      11. Timer and TimerTask
      12. Currency
      13. Formatter
        1. The Formatter Constructors
        2. The Formatter Methods
        3. Formatting Basics
        4. Formatting Strings and Characters
        5. Formatting Numbers
        6. Formatting Time and Date
        7. The %n and %% Specifiers
        8. Specifying a Minimum Field Width
        9. Specifying Precision
        10. Using the Format Flags
        11. Justifying Output
        12. The Space, +, 0, and ( Flags
        13. The Comma Flag
        14. The # Flag
        15. The Uppercase Option
        16. Using an Argument Index
        17. Closing a Formatter
        18. The Java printf( ) Connection
        19. Scanner
        20. The Scanner Constructors
        21. Scanning Basics
        22. Some Scanner Examples
        23. Setting Delimiters
        24. Other Scanner Features
      14. The ResourceBundle, ListResourceBundle, and PropertyResourceBundle Classes
      15. Miscellaneous Utility Classes and Interfaces
      16. The java.util Subpackages
        1. java.util.concurrent, java.util.concurrent.atomic, and java.util.concurrent.locks
        2. java.util.jar
        3. java.util.logging
        4. java.util.prefs
        5. java.util.regex
        6. java.util.spi
        7. java.util.zip
    5. CHAPTER 19 Input/Output: Exploring java.io
      1. The I/O Classes and Interfaces
      2. File
        1. Directories
        2. Using FilenameFilter
        3. The listFiles( ) Alternative
        4. Creating Directories
      3. The AutoCloseable, Closeable, and Flushable Interfaces
      4. I/O Exceptions
      5. Two Ways to Close a Stream
      6. The Stream Classes
      7. The Byte Streams
        1. InputStream
        2. OutputStream
        3. FileInputStream
        4. FileOutputStream
        5. ByteArrayInputStream
        6. ByteArrayOutputStream
        7. Filtered Byte Streams
        8. Buffered Byte Streams
        9. SequenceInputStream
        10. PrintStream
        11. DataOutputStream and DataInputStream
        12. RandomAccessFile
      8. The Character Streams
        1. Reader
        2. Writer
        3. FileReader
        4. FileWriter
        5. CharArrayReader
        6. CharArrayWriter
        7. BufferedReader
        8. BufferedWriter
        9. PushbackReader
        10. PrintWriter
      9. The Console Class
      10. Serialization
        1. Serializable
        2. Externalizable
        3. ObjectOutput
        4. ObjectOutputStream
        5. ObjectInput
        6. ObjectInputStream
        7. A Serialization Example
      11. Stream Benefits
    6. CHAPTER 20 Exploring NIO
      1. The NIO Classes
      2. NIO Fundamentals
        1. Buffers
        2. Channels
        3. Charsets and Selectors
      3. Enhancements Added to NIO by JDK 7
        1. The Path Interface
        2. The Files Class
        3. The Paths Class
        4. The File Attribute Interfaces
        5. The FileSystem, FileSystems, and FileStore Classes
      4. Using the NIO System
        1. Use NIO for Channel-Based I/O
        2. Use NIO for Stream-Based I/O
        3. Use NIO for Path and File System Operations
      5. Pre-JDK 7 Channel-Based Examples
        1. Read a File, Pre-JDK 7
        2. Write to a File, Pre-JDK 7
    7. CHAPTER 21 Networking
      1. Networking Basics
      2. The Networking Classes and Interfaces
      3. InetAddress
        1. Factory Methods
        2. Instance Methods
      4. Inet4Address and Inet6Address
      5. TCP/IP Client Sockets
      6. URL
      7. URLConnection
      8. HttpURLConnection
      9. The URI Class
      10. Cookies
      11. TCP/IP Server Sockets
      12. Datagrams
        1. DatagramSocket
        2. DatagramPacket
        3. A Datagram Example
    8. CHAPTER 22 The Applet Class
      1. Two Types of Applets
      2. Applet Basics
        1. The Applet Class
      3. Applet Architecture
      4. An Applet Skeleton
        1. Applet Initialization and Termination
        2. Overriding update( )
      5. Simple Applet Display Methods
      6. Requesting Repainting
        1. A Simple Banner Applet
      7. Using the Status Window
      8. The HTML APPLET Tag
      9. Passing Parameters to Applets
        1. Improving the Banner Applet
      10. getDocumentBase( ) and getCodeBase( )
      11. AppletContext and showDocument( )
      12. The AudioClip Interface
      13. The AppletStub Interface
      14. Outputting to the Console
    9. CHAPTER 23 Event Handling
      1. Two Event Handling Mechanisms
      2. The Delegation Event Model
        1. Events
        2. Event Sources
        3. Event Listeners
      3. Event Classes
        1. The ActionEvent Class
        2. The AdjustmentEvent Class
        3. The ComponentEvent Class
        4. The ContainerEvent Class
        5. The FocusEvent Class
        6. The InputEvent Class
        7. The ItemEvent Class
      4. The KeyEvent Class
        1. The MouseEvent Class
        2. The MouseWheelEvent Class
        3. The TextEvent Class
        4. The WindowEvent Class
      5. Sources of Events
      6. Event Listener Interfaces
        1. The ActionListener Interface
        2. The AdjustmentListener Interface
        3. The ComponentListener Interface
        4. The ContainerListener Interface
        5. The FocusListener Interface
        6. The ItemListener Interface
        7. The KeyListener Interface
        8. The MouseListener Interface
        9. The MouseMotionListener Interface
        10. The MouseWheelListener Interface
        11. The TextListener Interface
        12. The WindowFocusListener Interface
        13. The WindowListener Interface
      7. Using the Delegation Event Model
        1. Handling Mouse Events
        2. Handling Keyboard Events
      8. Adapter Classes
      9. Inner Classes
        1. Anonymous Inner Classes
    10. CHAPTER 24 Introducing the AWT: Working with Windows, Graphics, and Text
      1. AWT Classes
      2. Window Fundamentals
        1. Component
        2. Container
        3. Panel
        4. Window
        5. Frame
        6. Canvas
      3. Working with Frame Windows
        1. Setting the Window’s Dimensions
        2. Hiding and Showing a Window
        3. Setting a Window’s Title
        4. Closing a Frame Window
      4. Creating a Frame Window in an Applet
        1. Handling Events in a Frame Window
      5. Creating a Windowed Program
      6. Displaying Information Within a Window
      7. Working with Graphics
        1. Drawing Lines
        2. Drawing Rectangles
        3. Drawing Ellipses and Circles
        4. Drawing Arcs
        5. Drawing Polygons
        6. Sizing Graphics
      8. Working with Color
        1. Color Methods
        2. Setting the Current Graphics Color
        3. A Color Demonstration Applet
      9. Setting the Paint Mode
      10. Working with Fonts
        1. Determining the Available Fonts
        2. Creating and Selecting a Font
        3. Obtaining Font Information
      11. Managing Text Output Using FontMetrics
        1. Displaying Multiple Lines of Text
        2. Centering Text
        3. Multiline Text Alignment
    11. CHAPTER 25 Using AWT Controls, Layout Managers, and Menus
      1. Control Fundamentals
        1. Adding and Removing Controls
        2. Responding to Controls
        3. The HeadlessException
      2. Labels
      3. Using Buttons
        1. Handling Buttons
      4. Applying Check Boxes
        1. Handling Check Boxes
      5. CheckboxGroup
      6. Choice Controls
        1. Handling Choice Lists
      7. Using Lists
        1. Handling Lists
      8. Managing Scroll Bars
        1. Handling Scroll Bars
      9. Using a TextField
        1. Handling a TextField
      10. Using a TextArea
      11. Understanding Layout Managers
        1. FlowLayout
        2. BorderLayout
        3. Using Insets
        4. GridLayout
        5. CardLayout
        6. GridBagLayout
      12. Menu Bars and Menus
      13. Dialog Boxes
      14. FileDialog
      15. Handling Events by Extending AWT Components
        1. Extending Button
        2. Extending Checkbox
        3. Extending a Check Box Group
        4. Extending Choice
        5. Extending List
        6. Extending Scrollbar
      16. A Word About Overriding paint( )
    12. CHAPTER 26 Images
      1. File Formats
      2. Image Fundamentals: Creating, Loading, and Displaying
        1. Creating an Image Object
        2. Loading an Image
        3. Displaying an Image
      3. ImageObserver
      4. Double Buffering
      5. MediaTracker
      6. ImageProducer
        1. MemoryImageSource
      7. ImageConsumer
        1. PixelGrabber
      8. ImageFilter
        1. CropImageFilter
        2. RGBImageFilter
      9. Cell Animation
      10. Additional Imaging Classes
    13. CHAPTER 27 The Concurrency Utilities
      1. The Concurrent API Packages
        1. java.util.concurrent
        2. java.util.concurrent.atomic
        3. java.util.concurrent.locks
      2. Using Synchronization Objects
        1. Semaphore
        2. CountDownLatch
        3. CyclicBarrier
        4. Exchanger
      3. Phaser
      4. Using an Executor
        1. A Simple Executor Example
        2. Using Callable and Future
      5. The TimeUnit Enumeration
      6. The Concurrent Collections
      7. Locks
      8. Atomic Operations
      9. Parallel Programming via the Fork/Join Framework
        1. The Main Fork/Join Classes
        2. The Divide-and-Conquer Strategy
        3. A Simple First Fork/Join Example
        4. Understanding the Impact of the Level of Parallelism
        5. An Example that Uses RecursiveTask<V>
        6. Executing a Task Asynchronously
        7. Cancelling a Task
        8. Determining a Task’s Completion Status
        9. Restarting a Task
        10. Things to Explore
        11. Some Fork/Join Tips
      10. The Concurrency Utilities Versus Java’s Traditional Approach
    14. CHAPTER 28 Regular Expressions and Other Packages
      1. The Core Java API Packages
      2. Regular Expression Processing
        1. Pattern
        2. Matcher
        3. Regular Expression Syntax
        4. Demonstrating Pattern Matching
        5. Two Pattern-Matching Options
        6. Exploring Regular Expressions
      3. Reflection
      4. Remote Method Invocation (RMI)
        1. A Simple Client/Server Application Using RMI
      5. Text Formatting
        1. DateFormat Class
        2. SimpleDateFormat Class
  10. PART III Software Development Using Java
    1. CHAPTER 29 Java Beans
      1. What Is a Java Bean?
      2. Advantages of Java Beans
      3. Introspection
        1. Design Patterns for Properties
        2. Design Patterns for Events
        3. Methods and Design Patterns
        4. Using the BeanInfo Interface
      4. Bound and Constrained Properties
      5. Persistence
      6. Customizers
      7. The Java Beans API
        1. Introspector
        2. PropertyDescriptor
        3. EventSetDescriptor
        4. MethodDescriptor
      8. A Bean Example
    2. CHAPTER 30 Introducing Swing
      1. The Origins of Swing
      2. Swing Is Built on the AWT
      3. Two Key Swing Features
        1. Swing Components Are Lightweight
        2. Swing Supports a Pluggable Look and Feel
      4. The MVC Connection
      5. Components and Containers
        1. Components
        2. Containers
        3. The Top-Level Container Panes
      6. The Swing Packages
      7. A Simple Swing Application
      8. Event Handling
      9. Create a Swing Applet
      10. Painting in Swing
        1. Painting Fundamentals
        2. Compute the Paintable Area
        3. A Paint Example
    3. CHAPTER 31 Exploring Swing
      1. JLabel and ImageIcon
      2. JTextField
      3. The Swing Buttons
        1. JButton
        2. JToggleButton
        3. Check Boxes
        4. Radio Buttons
      4. JTabbedPane
      5. JList
      6. JComboBox
      7. Trees
      8. JTable
      9. Continuing Your Exploration of Swing
    4. CHAPTER 32 Servlets
      1. Background
      2. The Life Cycle of a Servlet
      3. Servlet Development Options
      4. Using Tomcat
      5. A Simple Servlet
        1. Create and Compile the Servlet Source Code
        2. Start Tomcat
        3. Start a Web Browser and Request the Servlet
      6. The Servlet API
      7. The javax.servlet Package
        1. The Servlet Interface
        2. The ServletConfig Interface
        3. The ServletContext Interface
        4. The ServletRequest Interface
        5. The ServletResponse Interface
        6. The GenericServlet Class
        7. The ServletInputStream Class
        8. The ServletOutputStream Class
        9. The Servlet Exception Classes
      8. Reading Servlet Parameters
      9. The javax.servlet.http Package
        1. The HttpServletRequest Interface
        2. The HttpServletResponse Interface
        3. The HttpSession Interface
        4. The HttpSessionBindingListener Interface
        5. The Cookie Class
        6. The HttpServlet Class
        7. The HttpSessionEvent Class
        8. The HttpSessionBindingEvent Class
      10. Handling HTTP Requests and Responses
        1. Handling HTTP GET Requests
        2. Handling HTTP POST Requests
      11. Using Cookies
      12. Session Tracking
  11. PART IV Applying Java
    1. CHAPTER 33 Financial Applets and Servlets
      1. Finding the Payments for a Loan
        1. The RegPay Fields
        2. The init( ) Method
        3. The makeGUI( ) Method
        4. The actionPerformed( ) Method
        5. The compute( ) Method
      2. Finding the Future Value of an Investment
      3. Finding the Initial Investment Required to Achieve a Future Value
      4. Finding the Initial Investment Needed for a Desired Annuity
      5. Finding the Maximum Annuity for a Given Investment
      6. Finding the Remaining Balance on a Loan
      7. Creating Financial Servlets
        1. Converting the RegPay Applet into a Servlet
        2. The RegPayS Servlet
      8. Some Things to Try
    2. CHAPTER 34 Creating a Download Manager in Java
      1. Understanding Internet Downloads
      2. An Overview of the Download Manager
      3. The Download Class
        1. The Download Variables
        2. The Download Constructor
        3. The download( ) Method
        4. The run( ) Method
        5. The stateChanged( ) Method
        6. Action and Accessor Methods
      4. The ProgressRenderer Class
      5. The DownloadsTableModel Class
        1. The addDownload( ) Method
        2. The clearDownload( ) Method
        3. The getColumnClass( ) Method
        4. The getValueAt( ) Method
        5. The update( ) Method
      6. The DownloadManager Class
        1. The DownloadManager Variables
        2. The DownloadManager Constructor
        3. The verifyUrl( ) Method
        4. The tableSelectionChanged( ) Method
        5. The updateButtons( ) Method
        6. Handling Action Events
      7. Compiling and Running the Download Manager
      8. Enhancing the Download Manager
    3. APPENDIX Using Java’s Documentation Comments
      1. The javadoc Tags
        1. @author
        2. {@code}
        3. @deprecated
        4. {@docRoot}
        5. @exception
        6. {@inheritDoc}
        7. {@link}
        8. {@linkplain}
        9. {@literal}
        10. @param
        11. @return
        12. @see
        13. @serial
        14. @serialData
        15. @serialField
        16. @since
        17. @throws
        18. {@value}
        19. @version
      2. The General Form of a Documentation Comment
      3. What javadoc Outputs
      4. An Example that Uses Documentation Comments
  12. Index