did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780201310085

Java¿ Language Specification

by ; ; ;
  • ISBN13:

    9780201310085

  • ISBN10:

    0201310082

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2000-06-05
  • Publisher: Addison-Wesley Professional
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.95

Summary

The Java™ programming language was originally called Oak, and was designed for use in embedded consumer-electronic applications by James Gosling. After several years of experience with the language, and significant contributions by Ed Frank, Patrick Naughton, Jonathan Payne, and Chris Warth it was retargeted to the Internet, renamed, and substantially revised to be the language specified here. The final form of the language was defined by James Gosling, Bill Joy, Guy Steele, Richard Tuck, Frank Yellin, and Arthur van Hoff, with help from Graham Hamil ton, Tim Lindholm, and many other friends and colleagues.

The Java programming language is a general-purpose concurrent class-based object-oriented programming language, specifically designed to have as few implementation dependencies as possible. It allows application developers to write a program once and then be able to run it everywhere on the Internet. This book attempts a complete specification of the syntax and semantics of the language. We intend that the behavior of every language construct is specified here, so that all implementations will accept the same programs. Except for timing dependencies or other non-determinisms and given sufficient time and sufficient memory space, a program written in the Java programming language should com pute the same result on all machines and in all implementations.

We believe that the Java programming language is a mature language, ready for widespread use. Nevertheless, we expect some evolution of the language in the years to come. We intend to manage this evolution in a way that is completely compatible with existing applications. To do this, we intend to make relatively few new versions of the language, and to distinguish each new version with a different filename extension. Compilers and systems will be able to support the several ver sions simultannously, with complete compatibility.

Much research and experimentation with the Java platform is already under way. We encourage this work, and will continue to cooperate with external groups to explore improvements to the language and platform. For example, we have already received several interesting proposals for parameterized types. In techni cally difficult areas, near the state of the art, this kind of research collaboration is essential.

We acknowledge and thank the many people who have contributed to this book through their excellent feedback, assistance and encouragement: Particularly thorough, careful, and thoughtful reviews of drafts were provided by Tom Cargill, Peter Deutsch, Paul Hilfinger, Masayuki Ida, David Moon, Steven Muchnick, Charles L. Perkins, Chris Van Wyk, Steve Vinoski, Philip Wadler, Daniel Weinreb, and Kenneth Zadeck. We are very grateful for their extraordinary volunteer efforts.

We are also grateful for reviews, questions, comments, and suggestions from Stephen Adams, Bowen Alpern, Glenn Ammons, Leonid Arbuzov, Kim Bruce, Edwin Chan, David Chase, Pavel Curtis, Drew Dean, William Dietz, David Dill, Patrick Dussud, Ed Felten, John Giannandrea, John Gilmore, Charles Gust, Warren Harris, Lee Hasiuk, Mike Hendrickson, Mark Hill, Urs Hoelzle, Roger Hoover, Susan Flynn Hummel, Christopher Jang, Mick Jordan, Mukesh Kacker, Peter Kessler, James Larus, Derek Lieber, Bill McKeeman, Steve Naroff, Evi Nemeth, Robert O'Callahan, Dave Papay, Craig Partridge, Scott Pfeffer, Eric Raymond, Jim Roskind, Jim Russell, William Scherlis, Edith Schonberg, Anthony Scian, Matthew Self, Janice Shepherd, Kathy Stark, Barbara Steele, Rob Strom, William Waite, Greg Weeks, and Bob Wilson. (This list was generated semi-automatically from our E-mail records. We apologize if we have omitted anyone.)

The feedback from all these reviewers was invaluable to us in improving the definition of the language as well as the form of the presentation in this book. We thank them for their diligence. Any remaining errors in this book---we hope they are few---are our responsibility and not theirs.

We thank Francesca Freedman and Doug Kramer for assistance with matters of typography and layout. We thank Dan Mills of Adobe Systems Incorporated for assistance in exploring possible choices of typefaces.

Many of our colleagues at Sun Microsystems have helped us in one way or another. Lisa Friendly, our series editor, managed our relationship with Addison Wesley. Susan Stambaugh managed the distribution of many hundreds of copies of drafts to reviewers. We received valuable assistance and technical advice from Ben Adida, Ole Agesen, Ken Arnold, Rick Cattell, Asmus Freytag, Norm Hardy, Steve Heller, David Hough, Doug Kramer, Nancy Lee, Marianne Mueller, Akira Tanaka, Greg Tarsy, David Ungar, Jim Waldo, Ann Wollrath, Geoff Wyant, and Derek White. We thank Alan Baratz, David Bowen, Mike Clary, John Doerr, Jon Kannegaard, Eric Schmidt, Bob Sproull, Bert Sutherland, and Scott McNealy for leadership and encouragement.

The on-line Bartleby Library of Columbia University, at URL: http://www.cc.columbia.edu/acis/bartleby/ was invaluable to us during the process of researching and verifying many of the quotations that are scattered throughout this book. Here is one example:

They lard their lean books with the fat of others' works.
---Robert Burton (1576--1640)
We are grateful to those who have toiled on Project Bartleby, for saving us a great deal of effort and reawakening our appreciation for the works of Walt Whitman.

We are thankful for the tools and services we had at our disposal in writing this book: telephones, overnight delivery, desktop workstations, laser printers, photocopiers, text formatting and page layout software, fonts, electronic mail, the World Wide Web, and, of course, the Internet. We live in three different states, scattered across a continent, but collaboration with each other and with our reviewers has seemed almost effortless. Kudos to the thousands of people who have worked over the years to make these excellent tools and services work quickly and reliably.

Mike Hendrickson, Katie Duffy, Simone Payment, and Rosa Aim"e GonzSumlez of Addison-Wesley were very helpful, encouraging, and patient during the long process of bringing this book to print. We also thank the copy editors. Rosemary Simpson worked hard, on a very tight schedule, to create the index. We got into the act at the last minute, however; blame us and not her for any jokes you may find hidden therein. Finally, we are grateful to our families and friends for their love and support during this last, crazy, year. In their book The C Programming Language, Brian Kernighan and Dennis Ritchie said that they felt that the C language "wears well as one's experience with it grows." If you like C, we think you will like the Java programming language.

We hope that it, too, wears well for you.

James Gosling--Cupertino, California
Bill Joy--Aspen, Colorado
Guy Steele--Chelmsford, Massachusetts
July, 1996

0201310082P04062001

Author Biography

Bill Joy is founder and Vice President of Research at Sun Microsystems.

Table of Contents

Table of Contents
vii
Preface xix
Preface to the Second Edition xxiii
Introduction
1(8)
Example Programs
5(1)
Notation
5(1)
Relationship to Predefined Classes and Interfaces
6(1)
References
6(3)
Grammars
9(4)
Context-Free Grammars
9(1)
The Lexical Grammar
9(1)
The Syntactic Grammar
10(1)
Grammar Notation
10(3)
Lexical Structure
13(18)
Unicode
13(1)
Lexical Translations
14(1)
Unicode Escapes
14(2)
Line Terminators
16(1)
Input Elements and Tokens
16(1)
White Space
17(1)
Comments
18(1)
Identifiers
19(1)
Keywords
20(1)
Literals
21(8)
Integer Literals
21(3)
Floating-Point Literals
24(1)
Boolean Literals
25(1)
Character Literals
26(1)
String Literals
27(1)
Escape Sequences for Character and String Literals
28(1)
The Null Literal
29(1)
Separators
29(1)
Operators
30(1)
Types, Values, and Variables
31(24)
The Kinds of Types and Values
32(1)
Primitive Types and Values
32(9)
Integral Types and Values
33(1)
Integer Operations
33(2)
Floating-Point Types, Formats, and Values
35(2)
Floating-Point Operations
37(3)
The boolean Type and boolean Values
40(1)
Reference Types and Values
41(5)
Objects
42(2)
The Class Object
44(1)
The Class String
45(1)
When Reference Types Are the Same
45(1)
Where Types Are Used
46(1)
Variables
47(8)
Variables of Primitive Type
48(1)
Variables of Reference Type
48(1)
Kinds of Variables
48(2)
final Variables
50(1)
Initial Values of Variables
50(2)
Types, Classes, and Interfaces
52(3)
Conversions and Promotions
55(26)
Kinds of Conversion
58(8)
Identity Conversions
58(1)
Widening Primitive Conversion
58(1)
Narrowing Primitive Conversions
59(3)
Widening Reference Conversions
62(1)
Narrowing Reference Conversions
63(1)
String Conversions
64(1)
Forbidden Conversions
64(1)
Value Set Conversion
65(1)
Assignment Conversion
66(5)
Method Invocation Conversion
71(1)
String Conversion
72(1)
Casting Conversion
72(5)
Numeric Promotions
77(4)
Unary Numeric Promotion
78(1)
Binary Numeric Promotion
79(2)
Names
81(38)
Declarations
82(1)
Names and Identifiers
83(2)
Scope of a Declaration
85(4)
Shadowing Declarations
86(3)
Obscured Declarations
89(1)
Members and Inheritance
89(4)
The Members of a Package
89(1)
The Members of a Class Type
90(1)
The Members of an Interface Type
91(1)
The Members of an Array Type
92(1)
Determining the Meaning of a Name
93(11)
Syntactic Classification of a Name According to Context
94(2)
Reclassification of Contextually Ambiguous Names
96(2)
Meaning of Package Names
98(1)
Simple Package Names
98(1)
Qualified Package Names
98(1)
Meaning of PackageOrTypeNames
98(1)
Simple PackageOrTypeNames
98(1)
Qualified PackageOrTypeNames
99(1)
Meaning of Type Names
99(1)
Simple Type Names
99(1)
Qualified Type Names
100(1)
Meaning of Expression Names
100(1)
Simple Expression Names
101(1)
Qualified Expression Names
102(2)
Meaning of Method Names
104(1)
Simple Method Names
104(1)
Qualified Method Names
104(1)
Access Control
104(7)
Determining Accessibility
105(1)
Details on protected Access
105(1)
Access to a protected Member
106(1)
Qualified Access to a protected Constructor
106(1)
An Example of Access Control
106(1)
Example: Access to public and Non-public Classes
107(1)
Example: Default-Access Fields, Methods, and Constructors
108(1)
Example: public Fields, Methods, and Constructors
109(1)
Example: protected Fields, Methods, and Constructors
110(1)
Example: private Fields, Methods, and Constructors
111(1)
Fully Qualified Names and Canonical Names
111(2)
Naming Conventions
113(6)
Package Names
113(1)
Class and Interface Type Names
114(1)
Method Names
115(1)
Field Names
115(1)
Constant Names
116(1)
Local Variable and Parameter Names
116(3)
Packages
119(16)
Package Members
119(1)
Host Support for Packages
120(3)
Storing Packages in a File System
121(1)
Storing Packages in a Database
122(1)
Compilation Units
123(1)
Package Declarations
124(1)
Named Packages
124(1)
Unnamed Packages
124(1)
Observability of a Package
125(1)
Scope of a Package Declaration
125(1)
Import Declarations
125(3)
Single-Type-Import Declaration
126(1)
Type-Import-on-Demand Declaration
127(1)
Automatic Imports
128(1)
A Strange Example
128(1)
Top Level Type Declarations
128(4)
Unique Package Names
132(3)
Classes
135(64)
Class Declaration
136(12)
Class Modifiers
137(1)
abstract Classes
137(2)
final Classes
139(1)
strictfp Classes
139(1)
Inner Classes and Enclosing Instances
140(2)
Superclasses and Subclasses
142(2)
Superinterfaces
144(3)
Class Body and Member Declarations
147(1)
Class Members
148(5)
Examples of Inheritance
149(1)
Example: Inheritance with Default Access
149(1)
Inheritance with public and protected
150(1)
Inheritance with private
151(1)
Accessing Members of Inaccessible Classes
151(2)
Field Declarations
153(14)
Field Modifiers
154(1)
static Fields
155(1)
final Fields
156(1)
transient Fields
156(1)
volatile Fields
156(2)
Initialization of Fields
158(1)
Initializers for Class Variables
159(1)
Initializers for Instance Variables
159(1)
Restrictions on the use of Fields during Initialization
160(2)
Examples of Field Declarations
162(1)
Example: Hiding of Class Variables
162(1)
Example: Hiding of Instance Variables
163(2)
Example: Multiply Inherited Fields
165(1)
Example: Re-inheritance of Fields
166(1)
Method Declarations
167(20)
Formal Parameters
168(1)
Method Signature
169(1)
Method Modifiers
169(1)
abstract Methods
170(1)
static Methods
171(1)
final Methods
172(1)
native Methods
173(1)
strictfp Methods
173(1)
synchronized Methods
174(1)
Method Throws
175(1)
Method Body
176(1)
Inheritance, Overriding, and Hiding
177(1)
Overriding (by Instance Methods)
177(1)
Hiding (by Class Methods)
178(1)
Requirements in Overriding and Hiding
178(1)
Inheriting Methods with the Same Signature
179(1)
Overloading
180(1)
Examples of Method Declarations
180(1)
Example: Overriding
180(1)
Example: Overloading, Overriding, and Hiding
181(1)
Example: Incorrect Overriding
181(1)
Example: Overriding versus Hiding
182(2)
Example: Invocation of Hidden Class Methods
184(1)
Large Example of Overriding
185(1)
Example: Incorrect Overriding because of Throws
186(1)
Member Type Declarations
187(1)
Access Modifiers
188(1)
Static Member Type Declarations
188(1)
Instance Initializers
188(1)
Static Initializers
189(1)
Constructor Declarations
190(9)
Formal Parameters
191(1)
Constructor Signature
191(1)
Constructor Modifiers
191(1)
Constructor Throws
192(1)
Constructor Body
192(1)
Explicit Constructor Invocations
193(2)
Constructor Overloading
195(1)
Default Constructor
195(2)
Preventing Instantiation of a Class
197(2)
Interfaces
199(10)
Interface Declarations
200(2)
Interface Modifiers
200(1)
abstract Interfaces
200(1)
strictfp Interfaces
200(1)
Superinterfaces and Subinterfaces
201(1)
Interface Body and Member Declarations
202(1)
Access to Interface Member Names
202(1)
Interface Members
202(1)
Field (Constant) Declarations
203(2)
Initialization of Fields in Interfaces
204(1)
Examples of Field Declarations
204(1)
Ambiguous Inherited Fields
204(1)
Multiply Inherited Fields
205(1)
Abstract Method Declarations
205(3)
Inheritance and Overriding
206(1)
Overloading
207(1)
Examples of Abstract Method Declarations
207(1)
Example: Overriding
207(1)
Example: Overloading
208(1)
Member Type Declarations
208(1)
Arrays
209(10)
Array Types
210(1)
Array Variables
210(1)
Array Creation
211(1)
Array Access
211(1)
Arrays: A Simple Example
212(1)
Array Initializers
212(1)
Array Members
213(2)
Class Objects for Arrays
215(1)
An Array of Characters is Not a String
215(1)
Array Store Exception
216(3)
Exceptions
219(10)
The Causes of Exceptions
220(1)
Compile-Time Checking of Exceptions
221(1)
Why Errors are Not Checked
221(1)
Why Runtime Exceptions are Not Checked
222(1)
Handling of an Exception
222(2)
Exceptions are Precise
223(1)
Handling Asynchronous Exceptions
224(1)
An Example of Exceptions
224(2)
The Exception Hierarchy
226(3)
Loading and Linkage Errors
227(1)
Virtual Machine Errors
227(2)
Execution
229(22)
Virtual Machine Start-Up
229(3)
Load the Class Test
230(1)
Link Test: Verify, Prepare, (Optionally) Resolve
230(1)
Initialize Test: Execute Initializers
231(1)
Invoke Test.main
232(1)
Loading of Classes and Interfaces
232(1)
The Loading Process
233(1)
Linking of Classes and Interfaces
233(3)
Verification of the Binary Representation
234(1)
Preparation of a Class or Interface Type
234(1)
Resolution of Symbolic References
235(1)
Initialization of Classes and Interfaces
236(5)
When Initialization Occurs
236(3)
Detailed Initialization Procedure
239(2)
Initialization: Implications for Code Generation
241(1)
Creation of New Class Instances
241(4)
Finalization of Class Instances
245(3)
Implementing Finalization
246(1)
Finalizer Invocations are Not Ordered
247(1)
Unloading of Classes and Interfaces
248(1)
Program Exit
249(2)
Binary Compatibility
251(24)
The Form of a Binary
252(4)
What Binary Compatibility Is and Is Not
256(1)
Evolution of Packages
257(1)
Evolution of Classes
257(14)
abstract Classes
257(1)
final Classes
258(1)
public Classes
258(1)
Superclasses and Superinterfaces
258(1)
Class Body and Member Declarations
259(2)
Access to Members and Constructors
261(1)
Field Declarations
262(2)
final Fields and Constants
264(2)
static Fields
266(1)
transient Fields
266(1)
Method and Constructor Declarations
267(1)
Method and Constructor Parameters
267(1)
Method Result Type
268(1)
abstract Methods
268(1)
final Methods
268(1)
native Methods
269(1)
static Methods
269(1)
synchronized Methods
270(1)
Method and Constructor Throws
270(1)
Method and Constructor Body
270(1)
Method and Constructor Overloading
270(1)
Method Overriding
271(1)
Static Initializers
271(1)
Evolution of Interfaces
271(4)
public Interfaces
272(1)
Superinterfaces
272(1)
The Interface Members
272(1)
Field Declarations
273(1)
Abstract Method Declarations
273(2)
Blocks and Statements
275(42)
Normal and Abrupt Completion of Statements
276(1)
Blocks
277(1)
Local Class Declarations
277(2)
Local Variable Declaration Statements
279(5)
Local Variable Declarators and Types
279(1)
Scope of Local Variable Declarations
280(3)
Shadowing of Names by Local Variables
283(1)
Execution of Local Variable Declarations
283(1)
Statements
284(1)
The Empty Statement
285(1)
Labeled Statements
286(1)
Expression Statements
286(1)
The if Statement
287(1)
The if-then Statement
288(1)
The if-then-else Statement
288(1)
The switch Statement
288(4)
The while Statement
292(1)
Abrupt Completion
292(1)
The do Statement
293(2)
Abrupt Completion
294(1)
Example of do statement
294(1)
The for Statement
295(2)
Initialization of for statement
295(1)
Iteration of for statement
296(1)
Abrupt Completion of for statement
297(1)
The break Statement
297(2)
The continue Statement
299(2)
The return Statement
301(1)
The throw Statement
302(2)
The synchronized Statement
304(1)
The try statement
305(5)
Execution of try-catch
307(1)
Execution of try-catch-finally
308(2)
Unreachable Statements
310(7)
Expressions
317(90)
Evaluation, Denotation, and Result
317(1)
Variables as Values
318(1)
Type of an Expression
318(1)
FP-strict Expressions
318(1)
Expressions and Run-Time Checks
319(1)
Normal and Abrupt Completion of Evaluation
320(2)
Evaluation Order
322(5)
Evaluate Left-Hand Operand First
322(2)
Evaluate Operands before Operation
324(1)
Evaluation Respects Parentheses and Precedence
325(1)
Argument Lists are Evaluated Left-to-Right
326(1)
Evaluation Order for Other Expressions
327(1)
Primary Expressions
327(3)
Lexical Literals
328(1)
Class Literals
328(1)
this
328(1)
Qualified this
329(1)
Parenthesized Expressions
330(1)
Class Instance Creation Expressions
330(7)
Determining the Class being Instantiated
331(1)
Determining Enclosing Instances
332(2)
Choosing the Constructor and its Arguments
334(1)
Run-time Evaluation of Class Instance Creation Expressions
334(1)
Anonymous Class Declarations
335(1)
Anonymous Constructors
335(1)
Example: Evaluation Order and Out-of-Memory Detection
336(1)
Array Creation Expressions
337(4)
Run-time Evaluation of Array Creation Expressions
338(1)
Example: Array Creation Evaluation Order
339(1)
Example: Array Creation and Out-of-Memory Detection
340(1)
Field Access Expressions
341(4)
Field Access Using a Primary
342(2)
Accessing Superclass Members using super
344(1)
Method Invocation Expressions
345(19)
Compile-Time Step 1: Determine Class or Interface to Search
346(1)
Compile-Time Step 2: Determine Method Signature
347(1)
Find Methods that are Applicable and Accessible
347(2)
Choose the Most Specific Method
349(1)
Example: Overloading Ambiguity
350(1)
Example: Return Type Not Considered
351(1)
Example: Compile-Time Resolution
352(2)
Compile-Time Step 3: Is the Chosen Method Appropriate?
354(2)
Runtime Evaluation of Method Invocation
356(1)
Compute Target Reference (If Necessary)
356(1)
Evaluate Arguments
357(1)
Check Accessibility of Type and Method
357(1)
Locate Method to Invoke
358(1)
Create Frame, Synchronize, Transfer Control
359(1)
Example: Target Reference and Static Methods
360(1)
Example: Evaluation Order
361(1)
Example: Overriding
361(2)
Example: Method Invocation using super
363(1)
Array Access Expressions
364(3)
Runtime Evaluation of Array Access
364(1)
Examples: Array Access Evaluation Order
365(2)
Postfix Expressions
367(1)
Postfix Increment Operator ++
367(1)
Postfix Decrement Operator --
368(1)
Unary Operators
368(4)
Prefix Increment Operator ++
369(1)
Prefix Decrement Operator --
369(1)
Unary Plus Operator +
370(1)
Unary Minus Operator -
370(1)
Bitwise Complement Operator ∼
371(1)
Logical Complement Operator !
371(1)
Cast Expressions
372(1)
Multiplicative Operators
373(4)
Multiplication Operator *
373(1)
Division Operator /
374(2)
Remainder Operator %
376(1)
Additive Operators
377(6)
String Concatenation Operator +
378(1)
String Conversion
378(1)
Optimization of String Concatenation
379(1)
Examples of String Concatenation
379(2)
Additive Operators (+ and -) for Numeric Types
381(2)
Shift Operators
383(1)
Relational Operators
384(2)
Numerical Comparison Operators <, <=, >, and >=
384(1)
Type Comparison Operator instanceof
385(1)
Equality Operators
386(2)
Numerical Equality Operators == and !=
387(1)
Boolean Equality Operators == and !=
388(1)
Reference Equality Operators == and !=
388(1)
Bitwise and Logical Operators
388(2)
Integer Bitwise Operators &, ∧, and |
389(1)
Boolean Logical Operators &, ∧, and |
389(1)
Conditional-And Operator &&
390(1)
Conditional-Or Operator | |
390(1)
Conditional Operator ? :
391(1)
Assignment Operators
392(13)
Simple Assignment Operator =
393(5)
Compound Assignment Operators
398(7)
Expression
405(1)
Constant Expression
405(2)
Definite Assignment
407(22)
Definite Assignment and Expressions
412(5)
Boolean Constant Expressions
412(1)
The Boolean Operator &&
413(1)
The Boolean Operator || |
413(1)
The Boolean Operator !
414(1)
The Boolean Operator ? :
414(1)
The Conditional Operator ? :
414(1)
Assignment Expressions
415(1)
Operators ++ and --
416(1)
Other Expressions
416(1)
Definite Assignment and Statements
417(8)
Empty Statements
418(1)
Blocks
418(1)
Local Class Declaration Statements
418(1)
Local Variable Declaration Statements
419(1)
Labeled Statements
419(1)
Expression Statements
419(1)
if Statements
420(1)
switch Statements
420(1)
while Statements
421(1)
do Statements
421(1)
for Statements
422(1)
Initialization Part
423(1)
Incrementation Part
423(1)
break, continue, return, and throw Statements
423(1)
synchronized Statements
424(1)
try Statements
424(1)
Definite Assignment and Parameters
425(1)
Definite Assignment and Array Initializers
425(1)
Definite Assignment and Anonymous Classes
426(1)
Definite Assignment and Member Types
426(1)
Definite Assignment and Static Initializers
426(1)
Definite Assignment, Constructors, and Instance Initializers
427(2)
Threads and Locks
429(20)
Terminology and Framework
431(2)
Execution Order
433(1)
Rules about Variables
434(1)
Nonatomic Treatment of double and long
435(1)
Rules about Locks
436(1)
Rules about the Interaction of Locks and Variables
436(1)
Rules for Volatile Variables
437(1)
Prescient Store Actions
438(1)
Discussion
438(1)
Example: Possible Swap
439(4)
Example: Out-of-Order Writes
443(2)
Threads
445(1)
Locks and Synchronization
445(1)
Wait Sets and Notification
446(3)
Syntax
449(8)
The Grammar of the Java Programming Language
449(8)
Index 457(46)
Credits 503(2)
Colophon 505

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

The Java programming language was originally called Oak, and was designed for use in embedded consumer-electronic applications by James Gosling. After several years of experience with the language, and significant contributions by Ed Frank, Patrick Naughton, Jonathan Payne, and Chris Warth it was retargeted to the Internet, renamed, and substantially revised to be the language specified here. The final form of the language was defined by James Gosling, Bill Joy, Guy Steele, Richard Tuck, Frank Yellin, and Arthur van Hoff, with help from Graham Hamil ton, Tim Lindholm, and many other friends and colleagues. The Java programming language is a general-purpose concurrent class-based object-oriented programming language, specifically designed to have as few implementation dependencies as possible. It allows application developers to write a program once and then be able to run it everywhere on the Internet. This book attempts a complete specification of the syntax and semantics of the language. We intend that the behavior of every language construct is specified here, so that all implementations will accept the same programs. Except for timing dependencies or other non-determinisms and given sufficient time and sufficient memory space, a program written in the Java programming language should com pute the same result on all machines and in all implementations. We believe that the Java programming language is a mature language, ready for widespread use. Nevertheless, we expect some evolution of the language in the years to come. We intend to manage this evolution in a way that is completely compatible with existing applications. To do this, we intend to make relatively few new versions of the language, and to distinguish each new version with a different filename extension. Compilers and systems will be able to support the several ver sions simultannously, with complete compatibility. Much research and experimentation with the Java platform is already under way. We encourage this work, and will continue to cooperate with external groups to explore improvements to the language and platform. For example, we have already received several interesting proposals for parameterized types. In techni cally difficult areas, near the state of the art, this kind of research collaboration is essential. We acknowledge and thank the many people who have contributed to this book through their excellent feedback, assistance and encouragement: Particularly thorough, careful, and thoughtful reviews of drafts were provided by Tom Cargill, Peter Deutsch, Paul Hilfinger, Masayuki Ida, David Moon, Steven Muchnick, Charles L. Perkins, Chris Van Wyk, Steve Vinoski, Philip Wadler, Daniel Weinreb, and Kenneth Zadeck. We are very grateful for their extraordinary volunteer efforts. We are also grateful for reviews, questions, comments, and suggestions from Stephen Adams, Bowen Alpern, Glenn Ammons, Leonid Arbuzov, Kim Bruce, Edwin Chan, David Chase, Pavel Curtis, Drew Dean, William Dietz, David Dill, Patrick Dussud, Ed Felten, John Giannandrea, John Gilmore, Charles Gust, Warren Harris, Lee Hasiuk, Mike Hendrickson, Mark Hill, Urs Hoelzle, Roger Hoover, Susan Flynn Hummel, Christopher Jang, Mick Jordan, Mukesh Kacker, Peter Kessler, James Larus, Derek Lieber, Bill McKeeman, Steve Naroff, Evi Nemeth, Robert O'Callahan, Dave Papay, Craig Partridge, Scott Pfeffer, Eric Raymond, Jim Roskind, Jim Russell, William Scherlis, Edith Schonberg, Anthony Scian, Matthew Self, Janice Shepherd, Kathy Stark, Barbara Steele, Rob Strom, William Waite, Greg Weeks, and Bob Wilson. (This list was generated semi-automatically from our E-mail records. We apologize if we have omitted anyone.) The feedback from all these reviewers was invaluable to us in improving the definition of the language as well as the

Rewards Program