The Java Language
Subject
The Java Language
Index
The Java Phenomenon
The Java Phenomenon
What Is Java?
The Origins of Java
Why Program in Java?
Java and HotJava
Java Overview
Java Overview
Getting the JDK
The Java Language
Java Is Familiar and Simple
Java Is Object- Oriented
Java Is Safer and More Reliable
Java Is Secure
Java Is Multithreaded
Java Is Interpreted and Portable
Java Is the Programming Language of the Web
The Java API
Object Oriented Programming Concept
Object-Oriented Programming Concepts
It's an Object-Oriented World
Composition and Reuse
Classes
Classification and Inheritance
Multiple Inheritance
Messages, Methods, and Object Interaction
Encapsulation
Polymorphism
Dynamic Binding
Java Classes
Class Syntax
[Example] > The Point Class
Class Modifiers
Extending Superclasses
Adding Body to Classes
Variable Declarations
[Example] > Constructor Declarations
Access Method Declarations
Java Interfaces
The Purpose of Java Interfaces
The Benefits of Interfaces
[Example] > Declaring Interfaces
[Example] > Implementing Interfaces
[Example] > Using Interfaces as Abstract Types
[Example] > Interface Constants
[Example] > Extending Interfaces
[Example] > Combining Interfaces
Exception
Eliminating Software Errors
Error Processing and Exceptions
[Example] > Throwing Exceptions
[Example] > Declaring Exceptions
Declare or Catch?
[Example] > Using the try Statement
[Example] > Catching Exceptions
Nested Exception Handling
[Example] > Rethrowing Exceptions
Analysis of NestedExceptionTest
Multithreading
Understanding Multithreading
How Java Supports Multithreading
[Example] > Creating Subclasses of Thread
[Example] > Implementing Runnable
Thread States
Thread Priority and Scheduling
[Example] > Synchronization
Daemon Threads
Thread Groups
Language Summary
Language Summary
The package Statement
The import Statement
[Example] > Comments
Identifiers
Reserved Words
[Example] > Primitive Data Types and Literal Values
Class Declarations
Variable Declarations
Constructor Declarations
Access Method Declarations
Static Initializers
Interfaces
Blocks and Block Bodies
Local Variable Declarations
Statements
Empty Statement
Block Statement
Method Invocation
Allocation Statements
Assignment Statements
The if Statement
Statement Labels
The switch Statement
The break Statement
The for Statement
The while Statement
The do Statement
The continue Statement
The synchronized Statement
The try Statement
The return Statement
Operators
Java I/O
Streams
The java.io Class Hierarchy
The InputStream Class
The read() Method
The available() Method
The close() Method
Markable Streams
The skip() Method
The OutputStream Class
The write() Method
The flush() Method
The close() Method
Byte Array I/O
The ByteArrayInputStream Class
The ByteArrayOutputStream Class
[Example] > The ByteArrayIOApp Program
[Example] > Listing 13.1. The source code of the ByteArrayIOApp program.
The StringBufferInputStream Class
File I/O
The java.io Class
The FileDescriptor Class
The FileInputStream Class
The FileOutputStream Class
[Example] > The FileIOApp Program
[Example] > Listing 13.2. The source code of the FileIOApp program.
The SequenceInputStream Class
[Example] > The SequenceIOApp Program
[Example] > Listing 13.3. The source code of the SequenceIOApp program.
Filtered I/O
The FilterInputStream Class
The FilterOutputStream Class
Buffered I/O
The BufferedInputStream Class
The BufferedOutputStream Class
[Example] > The BufferedIOApp Program
[Example] > Listing 13.4. The source code of the BufferedIOApp program.
PushbackInputStream
[Example] > The PushbackIOApp Program
[Example] > Listing 13.5. The source code of the PushbackIOApp program.
The LineNumberInputStream Class
[Example] > The LineNumIOApp Program
[Example] > Listing 13.6. The source code of the LineNumIOApp program.
Data I/O
The DataInputStream Class
The DataOutputStream Class
[Example] > The DataIOApp Program
[Example] > Listing 13.7. The source code of the DataIOApp program.
The PrintStream Class
Piped I/O
[Example] > The PipedIOApp Program
[Example] > Listing 13.8. The source code of the PipedIOApp program.
The RandomAccessFile Class
[Example] > The RandomIOApp Program
[Example] > Listing 13.9. The source code of the RandomIOApp program.
The StreamTokenizer Class
[Example] > The StreamTokenApp Program
[Example] > Listing 13.10. The source code of the StreamTokenApp program.
The Java Language
[Example] > Comments
Java Keywords
Primitive Types
Integer Types
[Example] > Floating-Point Types
Other Primitive Types
Default Values
[Example] > Casting Between Primitive Types
Literals
Integer Literals
[Example] > Floating-Point Literals
Boolean Literals
[Example] > Character Literals
[Example] > String Literals
Arrays
[Example] > Allocation
[Example] > Initialization
[Example] > Array Access
Operators
[Example] > Operators on Integers
Operators on Floating- Point Values
Operators on Boolean Values
Controlling Your Program
Selection
[Example] > The if Statement
[Example] > The switch Statement
Iteration
[Example] > The for Statement
[Example] > The while Statement
[Example] > The do...while Statement
Jumping
[Example] > The break Statement
[Example] > The continue Statement
[Example] > Using Labels
[Example] > Java Classes
[Example] > Field Declarations
[Example] > Field Access
[Example] > Setting Initial Values
[Example] > Static Members
[Example] > Member Methods
[Example] > Overloaded Methods
[Example] > Constructors
[Example] > The this Variable
[Example] > Class Inheritance
[Example] > Overriding Member Methods
The super Variable
Class Modifiers
[Example] > Abstract Classes
[Example] > Implementing Interfaces
Java Sintax
Language Grammar