Java编程语言:英文版

Java编程语言:英文版
作 者: Ken Arnold
出版社: 中国电力出版社
丛编项: 原版风暴·开发大师系列
版权说明: 本书为公共版权或经版权方授权,请支持正版图书
标 签: Java
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

  KenArnoldSunMicrosoystems实验室的总工程师,面向对象设计及实现方面的专家,是Jini技术的创建者之一,也是SunMicrosoystems技术的首席工程师。他特别擅长于编写UNIX下的C和C++程序,同时也是面向对象设计、C和C++领域的知名专家。

内容简介

这是一本众多Java Fans千呼万唤才出来的好书,本书由“Java之父”James Gosling以及另外两名顶级大师(Jini技术的创建者Ken Arnold和著名开发大师David Holmes)亲自撰写,无论是对Java语言的初学者还是资深使用者都具有极高折价值。至少有100000名使用C、C++、Smalltalk或者其他高级语言的开发人员通过阅读本书对Java语言有了准确、明智和深刻的认识。本书以Java语言创建者的独特视角向读者展现了为什么以及如何使用Java语言,以便读者理解Java语言的基本设计目标以及它在现实世界中的应用。本书介绍的是Java语言的最新版本,该版本在《Java Language Specification,Second Edition》中定义,在Java 2 SDK 1.3标准版中实现。本书已是第三版,在结构上相对前两版有所调整,重点讲述了新的语言特征,并提供了新API的使用实例。

图书目录

1 A Quick Tour

1.1 Getting Started

1.2 Variables

1.3 Comments in Code

1.4 Named Constants

1.5 Unicode Characters

1.6 Flow of Control

1.7 Classes and Objects

1.7.1 Creating Objects

1.7.2 Static or Class Fields

1.7.3 The Garbage Collector

1.8 Methods and Parameters

1.8.1 Invoking a Method

1.8.2 The this Reference

1.8.3 Static or Class Methods

1.9 Arrays

1.10 String Objects

1.11 Extending a Class

1.11.1 Invoking Methods from the Superclass

1.11.2 The object Class

1.11.3 Type Casting

1.12 Interfaces

1.13 Exceptions

1.14 Packages

1.15 The Java Platform

1.16 Other Topics Briefly Noted

2 Classes and Objects

2.1 A Simple Class

2.1.1 Classs Members

2.1.2 Class Modifiers

2.2 Fields

2.2.1 Field Initialization

2.2.2 Static Fields

2.2.3 final Fields

2.3 Access Control

2.4 Creating Objects

2.5 Construction and Initialization

2.5.1 Constructors

2.5.2 Initialization Blocks

2.5.3 Static Initialization

2.6 Methods

2.6.1 Static Methods

2.6.2 Method Invocations

2.6.3 Method Execution and Return

2.6.4 Parameter Values

2.6.5 Using Methods to Control Access

2.7 this

2.8 Overloading Methods

2.9 The main Method

2.10 Native Methods

3 Extending Classes

3.1 An Extended Class

3.2 Constructors in Extended Classes

3.2.1 Constructor Order Dependencies

3.3 Inheriting and Redefining Members

3.3.1 Overriding

3.3.2 Hiding Fields

3.3.3 Accessing Inherited Members

3.3.4 Accessibility and Overriding

3.3.5 Hiding Static Members

3.3.6 The super Keyword

3.4 Type Compatibility and Conversion

3.4.1 Compatibility

3.4.2 Explicit Type Casting

3.4.3 Testing for Type

3.5 What protected Really Means

3.6 Marking Methods and Classes final

3.7 Abstract Classes and Methods

3.8 The object Class

3.9 Cloning Objects

3.9.1 Strategies for Cloning

3.9.2 Correct Cloning

3.9.3 Shallow versus Deep Cloning

3.10 Extending Classes:How and When

3.11 Designing a Class to Be Extended

3.11.1 Designing an Extensible Framework

3.12 Single Inheritance versus Multiple Inheritance

4 Interfaces

4.1 A Simple Interface Example

4.2 Interface Declarations

4.2.1 Interface Constants

4.2.2 Interface Methods

4.2.3 Interface Modifiers

4.3 Extending Interfaces

4.3.1 Inheriting and Hiding Constants

4.3.2 Inheriting,Overriding,and Overloading Methods

4.4 Working with Interfaces

4.4.1 Implementing Interfaces

4.4.2 Using an Implementation

4.5 Marker Interfaces

4.6 When to Use Interfaces

5 Nested Classes and Interfaces

5.1 Static Nested Types

5.1.1 Static Nested Classes

5.1.2 Nested Interfaces

5.2 Inner Classes

5.2.1 Accessing Enclosing Objects

5.2.2 Extending Inner Classes

5.2.3 Inheritance,Scoping,and Hiding

5.3 Local Inner Classes

5.4 Anonymous Inner Classes

5.5 Inheriting Nested Types

5.6 Nesting in Interfaces

5.6.1 Modifiable Variables in Interfaces

5.7 Implementation of Nested Types

6 Tokens,Operators,and Expressions

6.1 Lexical Elements

6.1.1 Character Set

6.1.2 Comments

6.1.3 Tokens

6.1.4 Identifiers

6.1.5 Keywords

6.2 Types and Literals

6.2.1 Reference Literals

6.2.2 Boolean Literals

6.2.3 Character Literals

6.2.4 Integer Literals

6.2.5 Floating-Point Literals

6.2.6 String Literals

6.2.7 Class Literals

6.3 Variables

6.3.1 Field and Local Variable Declarations

6.3.2 Parameter Variables

6.3.3 final Variables

6.4 Array Variables

6.4.1 Array Modifiers

6.4.2 Arrays of Arrays

6.4.3 Array Initialization

6.4.4 Arrays and Types

6.5 The Matnings of Names

6.6 Arithmetic Operations

6.6.1 Integer Arithmetic

6.6.2 Floating-Point Arithmetic

6.6.3 Strict and non-Strict Floating-Point Arithmetic

6.7 General Operators

6.7.1 Increment and Decrement Operators

6.7.2 Relational and Equality Operators

6.7.3 Logical Operators

6.7.4 instanceof

6.7.5 Bit Manipulation Operators

6.7.6 The Conditional Operator?:

6.7.7 Assignment zoperators

6.7.8 String Concatenation Operator

6.7.9 new

6.8 Expressions

6.8.1 Order of Evaluation

6.8.2 Expression Type

6.8.3 Implicit Type Conversions

6.8.4 Explicit Type Casts

6.8.5 String Conversions

6.9 Member Access

6.9.1 Finding the Right Method

6.10 Operator Precedence and Associativity

7 Control Flow

7.1 Statements and Blocks

7.2 if-else

7.3 switch

7.4 while and do-while

7.5 for

7.6 Labels

7.7 break

7.8 continue

7.9 return

7.10 What,No goto?

8 Exceptions

8.1 Creating Exception Types

8.2 throw

8.2.1 Transfer of Control

8.2.2 Asynchronous Exceptions

8.3 The throws Clause

8.3.1 throws Clauses and Method Overriding

8.3.2 throws Clauses and Native Methods

8.4 try,catch,and finally

8.4.1 finally

8.5 When to Use Exceptions

9 Strings

9.1 Basic String Operations

9.2 String Comparisons

9.2.1 String Literal Equivalence

9.3 Utility Methods

9.4 Making Related Strings

9.5 String Conversions

9.6 Strings and char Arrays

9.7 Strings and byte Arrays

9.7.1 Character Encodings

9.8 The StringBuffer Class

9.8.1 Modifying the Buffer

9.8.2 Getting Data Out

9.8.3 Capacity Management

10 Threads

10.1 Creating Threads

10.2 Using Runnable

10.3 Synchronization

10.3.1 synchronized Methods

10.3.2 Static Synchronized Methods

10.3.3 synchronized Statements

10.3.4 Synchronization Designs

10.4 wait,notifyAll,and notify

10.5 Details of Waiting and Notification

10.6 Thread Scheduling

10.6.1 Voluntary Rescheduling

10.7 Deadlocks

10.8 ending Thread Execution

10.8.1 Cancelling a Thread

10.8.2 Waiting for a Thread to Complete

10.9 Ending Application Execution

10.10 volatile

10.11 Thread Management,Security and Threadgroup

10.12 Threads and Exceptions

10.12.1 Don't stop

10.13 Threadlocal Variables

10.14 Debugging Threads

11 Programming with Types

11.1 Wrapper Classes

11.1.1 void

11.1.2 Boolean

11.1.3 Character

11.1.4 Number

11.1.5 The Integer Wrappers

11.1.6 The Floating-Point Wrapper Classes

11.2 Reflection

11.2.1 The Class class

11.2.2 Naming Classes

11.2.3 Examining Class Members

11.2.4 The Modifier Class

11.2.5 The Field Class

11.2.6 The Method Class

11.2.7 Creating New Objects and the Constructor Class

11.2.8 Access Checking and Accessibleobject

11.2.9 Arrays

11.2.10 Packages

11.2.11 The Proxy Class

11.3 Loading Classes

11.3.1 The Classloader Class

11.3.2 Preparing a Class for use

11.3.3 Loading Related Resources

12 Garbage Collection and Memory

12.1 Garbage Collection

12.2 A Simple Model

12.3 Fonalization

12.3.1 Resurrecting Objects during finalize

12.4 Interacting with the Garbage Collector

12.5 Reachability States and Reference Objects

12.5.1 The Reference Class

12.5.2 Strengths of Reference and Reachability

12.5.3 Reference Queues

13 Packages

13.1 Package Naming

13.2 Type Imports

13.3 Package Access

13.3.1 Accessibility and Overriding Methods

13.4 Package Contents

13.5 Package Objects and Specifications

14 Documentation Comments

14.1 The Anatomy of a Doc Comment

14.2 Tags

14.2.1 @see

14.2.2 {@link}

14.2.3 @param

14.2.4 @return

14.2.5 @throws and @exception

14.2.6 @deprecated

14.2.7 @author

14.2.8 @version

14.2.9 @since

14.2.10 {@docRoot}

14.3 An Example

14.4 External Conventions

14.4.1 Overview and Package Documentation

14.4.2 The doc-files Directory

14.5 Notes on Usage

15 The I/O Package

15.1 Byte Streams

15.1.1 Inputstream

15.1.2 Outputstream

15.2 Character Streams

15.2.1 rReader

15.2.2 Writer

15.2.3 Character Streams and the Standard Streams

15.3 InputstreamReader and OutputStreamWriter

15.4 A Quick Tour of The Stream Classes

15.4.1 Synchronization and Concurrency

15.4.2 Filter Streams

15.4.3 Buffered Streams

15.4.4 Piped Streams

15.4.5 ByteArray Byte Streams

15.4.6 CharArray Character Streams

15.4.7 String Character Streams

15.4.8 Print Streams

15.4.9 LineNumberReader

15.4.10 SequenceInputstream

15.4.11 Pushback Streams

15.4.12 StreamTokenizer

15.5 The Data Byte Streams

15.5.1 DataInput and DataOutput

15.5.2 The Data Stream Classes

15.6 Working with Files

15.6.1 File Streams and FileDescriptor

15.6.2 RandomAccessfile

15.6.3 The File Class

15.6.4 FilenameFilter and FileFilter

15.7 Object Serialization

15.7.1 The Object Byte Streams

15.7.2 Making Your Classes Serializable

15.7.3 Serialization and Deserialization Order

15.7.4 Customized Serialization

15.7.5 Object Versioning

15.7.6 Serialized Fields

15.7.7 The Externalizable Interface

15.7.8 Documentation Comment Tags

15.8 The IOException Classes

16 Collections

16.1 Collections

16.1.1 Exception Conventions

16.2 Iteration

16.3 Ordering using Comparable and Comparator

16.4 The Collection Interface

16.5 Set and Sortedset

16.5.1 Hashset

16.5.2 TreeSet

16.6 List

16.6.1 ArrayList

16.6.2 LinkedList

16.7 Map and SortedMap

16.7.1 HashMap

16.7.2 TreeMap

16.7.3 WeakHashMap

16.8 Wrapped Collections Class

16.8.1 The Synchronization Wrappers

16.8.2 The Unmodifiable Wrappers

16.8.3 The Collections Utlities

16.9 The Arrays Utility Class

16.10 Writing Iterator Implementations

16.11 Writing Collection Implementations

16.12 The Leagcy Collection Types

16.12.1 Enumeration

16.12.2 Vector

16.12.3 stack

16.12.4 Dictionary

16.12.5 Hashtable

16.13 Properties

17 Miscellaneous Utilities

17.1 Bitset

17.2 Observer/Observable

17.3 Random

17.4 StringTokenizer

17.5 Timer and TimerTask

17.6 Math and StrictMath

18 System Programming

18.1 The System Class

18.1.1 Standard I/O Streams

18.1.2 System Properties

18.1.3 Utility Methods

18.2 Creating Processes

18.2.1 The Process Class

18.2.2 Process Environments

18.2.3 Portability

18.3 Shutdown

18.3.1 Shutdown Hooks

18.3.2 The Shutdown Sequence

18.3.3 Shutdown Strategies

18.4 The Rest of the Runtime

18.4.1 Loading Native Code

18.4.2 Debugging

18.5 Security

18.5.1 The SecurityManager Class

18.5.2 Permissions

18.5.3 Security Policies

18.5.4 Access Controllers and Privileged Execution

19 Internationalization and Localization

19.1 Locale

19.2 Resoruce Bundles

19.2.1 ListResourceBundle

19.2.2 PropertyResourceBundle

19.2.3 Subclassing ResourceBundle

19.3 Time,Dates,and Calendars

19.3.1 Calendars

19.3.2 Time Zones

19.3.3 GregorianCalendar and SimpleTimeZone

19.4 Formatting and Parsing Dates and Times

19.5 Internationalization and Localization for Text

19.5.1 Collation

19.5.2 Formatting and Parsing

19.5.3 Text Boundaries

20 Standard Packages

20.1 java.awt-The Abstract Window Toolkit

20.2 java.applet-Applets

20.3 java.beans-Components

20.4 java.math-Mathematics

20.5 java.net-The Network

20.6 java.rmi-Remote Method Invocation

20.7 java.security-Security Tools

20.8 java.sql-Relational Database Access

20.9 Utility Subpackages

20.9.1 Archive Files-java.util.jar

20.9.2 ZIP Files-java.util.zip

20.10 javax.*-Standard Extensions

20.11 javax.accessibility-Accessibility for GUIs

20.12 javax.naming-Directory and Naming Services

20.13 javax.sound-Sound Manipulation

20.14 javax.swing-Swing GUI Components

20.15 org.omg.CORBA-CORBA APIs

A Runtime Exceptions

A.1 RuntimeException Classes

A.2 Error Classes

B Useful Tables

Table 1: Keywords

Table 2: Operator Precedence

Table 3: Unicode Digits

Table 4: Unicode Letters and Digits

Table 5: Special Characters Using\

Table 6: Documentation Comment Tags

Table 7: Unicode Character Blocks

Table 8: Required Character Encodings

Further Reading

Index