معرفی کتاب «مشخصات زبان جاوا، ویرایش سوم» (با عنوان لاتین The Java Language Specification, Third Edition) نوشتهٔ James Gosling, Bill Joy, Guy L. Steele Jr., Gilad Bracha, James Gosling, Alex Buckley، منتشرشده توسط نشر Addison Wesley در سال 2005. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Written by the inventors of the technology, **The JavaTM Language Specification, Third Edition , is the definitive technical reference for the JavaTM programming language. If you want to know the precise meaning of the language's constructs, this is the source for you.** The book provides complete, accurate, and detailed coverage of the Java programming language. It provides full coverage of all new features added since the previous edition, including generics, annotations, asserts, autoboxing, enums, for-each loops, variable arity methods, and static import clauses. The JavaTM Language Specification, 3rd Edition ......Page 1 Preface......Page 23 Preface to the Second Edition......Page 27 Preface to the Third Edition......Page 31 CHAPTER 1 Introduction......Page 35 1.1 Example Programs......Page 39 1.4 References......Page 40 2.2 The Lexical Grammar......Page 43 2.4 Grammar Notation......Page 44 3.1 Unicode......Page 47 3.2 Lexical Translations......Page 48 3.3 Unicode Escapes......Page 49 3.4 Line Terminators......Page 50 3.5 Input Elements and Tokens......Page 51 3.7 Comments......Page 52 3.8 Identifier......Page 53 3.10 Literals......Page 55 3.10.1 Integer Literals......Page 56 3.10.2 Floating-Point Literals......Page 58 3.10.4 Character Literals......Page 60 3.10.5 String Literals......Page 62 3.10.7 The Null Literal......Page 64 3.12 Operators......Page 65 CHAPTER 4 Types, Values, and Variables......Page 67 4.1 The Kinds of Types and Values......Page 68 4.2.1 Integral Types and Values......Page 69 4.2.2 Integer Operations......Page 70 4.2.3 Floating-Point Types, Formats, and Values......Page 71 4.2.4 Floating-Point Operations......Page 74 4.2.5 The......Page 77 4.3 Reference Types and Values......Page 78 4.3.1 Objects......Page 79 4.3.2 The Class......Page 81 4.3.3 The Class......Page 82 4.4 Type Variables......Page 83 4.5 Parameterized Types......Page 85 4.5.1 Type Arguments and Wildcards......Page 86 4.5.2 Members and Constructors of Parameterized Types......Page 89 4.7 Reifiable ypes......Page 90 4.8 Raw Types......Page 91 4.9 Intersection Types......Page 96 4.10.2 Subtyping among Class and Interface Types......Page 97 4.10.3 Subtyping among Array Types......Page 98 4.11 Where Types Are Used......Page 99 4.12.2 Variables of Reference Type......Page 101 4.12.3 Kinds of Variables......Page 103 4.12.5 Initial Values of Variables......Page 105 4.12.6 Types, Classes, and Interfaces......Page 107 CHAPTER 5 Conversions and Promotions......Page 111 5.1.2 Widening Primitive Conversion......Page 114 5.1.3 Narrowing Primitive Conversions......Page 116 5.1.4 Widening and Narrowing Primitive Conversions......Page 118 5.1.6 Narrowing Reference Conversions......Page 119 5.1.7 Boxing Conversion......Page 120 5.1.8 Unboxing Conversion......Page 122 5.1.10 Capture Conversion......Page 123 5.1.13 Value Set Conversion......Page 126 5.2 Assignment Conversion......Page 127 5.3 Method Invocation Conversion......Page 133 5.5 Casting Conversion......Page 135 5.6.1 Unary Numeric Promotion......Page 142 5.6.2 Binary Numeric Promotion......Page 144 CHAPTER 6 Names......Page 147 6.1 Declarations......Page 148 6.2 Names and Identifier......Page 149 6.3 Scope of a Declaration......Page 151 6.3.1 Shadowing Declarations......Page 153 6.4.2 The Members of a Package......Page 156 6.4.3 The Members of a Class Type......Page 157 6.4.4 The Members of an Interface Type......Page 158 6.4.5 The Members of an Array Type......Page 159 6.5 Determining the Meaning of a Name......Page 160 6.5.1 Syntactic Classification of a Name According to Contex......Page 161 6.5.2 Reclassification of Contextually Ambiguous Name......Page 163 6.5.3 Meaning of Package Names......Page 165 6.5.5 Meaning of Type Names......Page 166 6.5.6 Meaning of Expression Names......Page 168 6.5.7 Meaning of Method Names......Page 171 6.6.1 Determining Accessibility •......Page 172 6.6.2 Details on......Page 173 6.6.3 An Example of Access Control......Page 174 6.6.4 Example: Access to......Page 175 6.6.5 Example: Default-Access Fields, Methods, and Constructors......Page 176 6.6.7 Example:......Page 177 6.6.8 Example:......Page 178 6.7 Fully Qualified Names and Canonical Name......Page 179 6.8 Naming Conventions......Page 180 6.8.2 Class and Interface Type Names......Page 181 6.8.3 Type Variable Names......Page 182 6.8.4 Method Names......Page 183 6.8.6 Constant Names......Page 184 6.8.7 Local Variable and Parameter Names......Page 185 CHAPTER 7 Packages......Page 187 7.1 Package Members......Page 188 7.2.1 Storing Packages in a File System......Page 189 7.3 Compilation Units......Page 191 7.4.1 Named Packages......Page 192 7.4.2 Unnamed Packages......Page 193 7.5 Import Declarations......Page 194 7.5.1 Single-Type-Import Declaration......Page 195 7.5.2 Type-Import-on-Demand Declaration......Page 197 7.5.3 Single Static Import Declaration......Page 198 7.5.6 A Strange Example......Page 199 7.6 Top Level Type Declarations......Page 200 7.7 Unique Package Names......Page 203 CHAPTER 8 Classes......Page 207 8.1.1 Class Modifier......Page 209 8.1.2 Generic Classes and Type Parameters......Page 212 8.1.3 Inner Classes and Enclosing Instances......Page 215 8.1.4 Superclasses and Subclasses......Page 218 8.1.5 Superinterfaces......Page 220 8.1.6 Class Body and Member Declarations......Page 223 8.2 Class Members......Page 224 8.2.1 Examples of Inheritance......Page 226 8.3 Field Declarations......Page 230 8.3.1 Field Modifier......Page 231 8.3.2 Initialization of Fields......Page 235 8.3.3 Examples of Field Declarations......Page 239 8.4 Method Declarations......Page 243 8.4.1 Formal Parameters......Page 244 8.4.2 Method Signature......Page 246 8.4.3 Method Modifier......Page 248 8.4.5 Method Return Type......Page 254 8.4.6 Method Throws......Page 255 8.4.7 Method Body......Page 257 8.4.8 Inheritance, Overriding, and Hiding......Page 258 8.4.9 Overloading......Page 263 8.4.10 Examples of Method Declarations......Page 264 8.5 Member Type Declarations......Page 271 8.6 Instance Initializers......Page 272 8.7 Static Initializers......Page 273 8.8.1 Formal Parameters and Formal Type Parameter......Page 274 8.8.3 Constructor Modifier......Page 275 8.8.7 Constructor Body......Page 276 8.8.8 Constructor Overloading......Page 280 8.8.9 Default Constructor......Page 281 8.8.10 Preventing Instantiation of a Class......Page 282 8.9 Enums......Page 283 CHAPTER 9 Interfaces......Page 293 9.1.1 Interface Modifier......Page 294 9.1.3 Superinterfaces and Subinterfaces......Page 295 9.2 Interface Members......Page 297 9.3 Field (Constant) Declarations......Page 298 9.3.2 Examples of Field Declarations......Page 299 9.4 Abstract Method Declarations......Page 300 9.4.1 Inheritance and Overriding......Page 301 9.4.2 Overloading......Page 302 9.4.3 Examples of Abstract Method Declarations......Page 303 9.6 Annotation Types......Page 304 9.6.1 Predefined Annotation ypes......Page 311 9.7 Annotations......Page 315 CHAPTER 10 Arrays......Page 321 10.2 Array Variables......Page 322 10.4 Array Access......Page 323 10.6 Array Initializers......Page 324 10.7 Array Members......Page 326 10.10 Array Store Exception......Page 328 CHAPTER 11 Exceptions......Page 331 11.1 The Causes of Exceptions......Page 332 11.2.1 Exception Analysis of Expressions......Page 333 11.2.2 Exception Analysis of Statements......Page 334 11.2.5 Why Runtime Exceptions are Not Checked......Page 335 11.3 Handling of an Exception......Page 336 11.3.2 Handling Asynchronous Exceptions......Page 337 11.4 An Example of Exceptions......Page 338 11.5 The Exception Hierarchy......Page 340 11.5.2 Virtual Machine Errors......Page 341 12.1 Virtual Machine Start-Up......Page 343 12.1.2 Link......Page 344 12.1.3 Initialize......Page 345 12.2 Loading of Classes and Interfaces......Page 346 12.2.1 The Loading Process......Page 347 12.3.1 Verification of the Binary Repesentation......Page 348 12.3.3 Resolution of Symbolic References......Page 349 12.4.1 When Initialization Occurs......Page 350 12.4.2 Detailed Initialization Procedure......Page 353 12.4.3 Initialization: Implications for Code Generation......Page 355 12.5 Creation of New Class Instances......Page 356 12.6 Finalization of Class Instances......Page 359 12.6.1 Implementing Finalization......Page 360 12.6.2 Finalizer Invocations are Not Ordered......Page 363 12.7 Unloading of Classes and Interfaces......Page 364 12.8 Program Exit......Page 365 CHAPTER 13 Binary Compatibility......Page 367 13.1 The Form of a Binary......Page 368 13.2 What Binary Compatibility Is and Is Not......Page 373 13.4 Evolution of Classes......Page 374 13.4.4 Superclasses and Superinterfaces......Page 375 13.4.6 Class Body and Member Declarations......Page 376 13.4.7 Access to Members and Constructors......Page 378 13.4.8 Field Declarations......Page 379 13.4.13 Method and Constructor Formal Type Parameters......Page 384 13.4.15 Method Result Type......Page 386 13.4.22 Method and Constructor Body......Page 388 13.4.23 Method and Constructor Overloading......Page 389 13.5 Evolution of Interfaces......Page 390 13.5.4 Interface Formal Type Parameters......Page 391 13.5.7 Evolution of Annotation Types......Page 392 CHAPTER 14 Blocks and Statements......Page 393 14.1 Normal and Abrupt Completion of Statements......Page 394 14.3 Local Class Declarations......Page 395 14.4 Local Variable Declaration Statements......Page 397 14.4.2 Scope of Local Variable Declarations......Page 398 14.4.4 Execution of Local Variable Declarations......Page 401 14.5 Statements......Page 402 14.7 Labeled Statements......Page 404 14.8 Expression Statements......Page 405 14.9.2 The......Page 406 14.10 The......Page 407 14.11 The......Page 411 14.12 The......Page 414 14.12.1 Abrupt Completion......Page 415 14.13 The......Page 416 14.13.2 Example of......Page 417 14.14.1 The basic for Statement......Page 418 14.14.2 The enhanced for statement......Page 421 14.15 The......Page 422 14.16 The......Page 424 14.17 The......Page 426 14.18 The......Page 427 14.19 The......Page 429 14.20 The......Page 430 14.20.1 Execution of......Page 432 14.20.2 Execution of......Page 433 14.21 Unreachable Statements......Page 436 15.1 Evaluation, Denotation, and Result......Page 443 15.3 Type of an Expression......Page 444 15.5 Expressions and Run-Time Checks......Page 445 15.6 Normal and Abrupt Completion of Evaluation......Page 447 15.7 Evaluation Order......Page 448 15.7.1 Evaluate Left-Hand Operand First......Page 449 15.7.2 Evaluate Operands before Operation......Page 450 15.7.3 Evaluation Respects Parentheses and Precedence......Page 451 15.7.4 Argument Lists are Evaluated Left-to-Right......Page 452 15.7.5 Evaluation Order for Other Expressions......Page 453 15.8.1 Lexical Literals......Page 454 15.8.2 Class Literals......Page 455 15.8.5 Parenthesized Expressions......Page 456 15.9 Class Instance Creation Expressions......Page 457 15.9.1 Determining the Class being Instantiated......Page 458 15.9.2 Determining Enclosing Instances......Page 459 15.9.3 Choosing the Constructor and its Arguments......Page 461 15.9.4 Run-time Evaluation of Class Instance Creation Expressions......Page 462 15.9.5 Anonymous Class Declarations......Page 463 15.9.6 Example: Evaluation Order and Out-of-Memory Detection......Page 464 15.10 Array Creation Expressions......Page 465 15.10.1 Run-time Evaluation of Array Creation Expressions......Page 466 15.10.2 Example: Array Creation Evaluation Order......Page 467 15.10.3 Example: Array Creation and Out-of-Memory Detection......Page 468 15.11.1 Field Access Using a Primary......Page 469 15.11.2 Accessing Superclass Members using......Page 472 15.12.1 Compile-Time Step 1: Determine Class or Interface to Search......Page 474 15.12.2 Compile-Time Step 2: Determine Method Signature......Page 476 15.12.3 Compile-Time Step 3: Is the Chosen Method Appropriate?......Page 505 15.12.4 Runtime Evaluation of Method Invocation......Page 507 15.13 Array Access Expressions......Page 516 15.13.2 Examples: Array Access Evaluation Order......Page 517 15.14.2 Postfix Incement Operator......Page 519 15.14.3 Postfix Decement Operator......Page 520 15.15.1 Prefix Incement Operator......Page 521 15.15.2 Prefix Decement Operator......Page 522 15.15.4 Unary Minus Operator......Page 523 15.16 Cast Expressions......Page 524 15.17 Multiplicative Operators......Page 525 15.17.1 Multiplication Operator......Page 526 15.17.2 Division Operator......Page 527 15.17.3 Remainder Operator......Page 529 15.18 Additive Operators......Page 530 15.18.1 String Concatenation Operator......Page 531 15.18.2 Additive Operators (......Page 534 15.19 Shift Operators......Page 536 15.20.1 Numerical Comparison Operators......Page 537 15.20.2 Type Comparison Operator......Page 538 15.21 Equality Operators......Page 539 15.21.1 Numerical Equality Operators......Page 540 15.21.3 Reference Equality Operators......Page 541 15.22.2 Boolean Logical Operators......Page 542 15.24 Conditional-Or Operator......Page 543 15.25 Conditional Operator......Page 544 15.26 Assignment Operators......Page 546 15.26.1 Simple Assignment Operator......Page 547 15.26.2 Compound Assignment Operators......Page 552 15.28 Constant Expression......Page 559 CHAPTER 16 Definite Assignmen......Page 561 16.1.2 The Boolean Operator......Page 567 16.1.5 The Boolean Operator......Page 568 16.1.8 Assignment Expressions......Page 569 16.1.10 Other Expressions......Page 570 16.2.2 Blocks •......Page 572 16.2.4 Local Variable Declaration Statements •......Page 573 16.2.6 Expression Statements •......Page 574 16.4 Definite Assignment and Array Initializer......Page 581 16.6 Definite Assignment and Anonymous Classe......Page 582 16.8 Definite Assignment and Static Initializer......Page 583 16.9 Definit Assignment, Constructors, and Instance Initializers......Page 584 CHAPTER 17 Threads and Locks......Page 587 17.2 Notation in Examples......Page 588 17.3 Incorrectly Synchronized Programs Exhibit Surprising......Page 589 17.4 Memory Model......Page 591 17.4.2 Actions......Page 592 17.4.3 Programs and Program Order......Page 594 17.4.5 Happens-before Order......Page 595 17.4.6 Executions......Page 601 17.4.8 Executions and Causality Requirements......Page 602 17.4.9 Observable Behavior and Nonterminating Executions......Page 605 17.5 Final Field Semantics......Page 607 17.5.1 Semantics of Final Fields......Page 609 17.5.3 Subsequent Modification of Final Field......Page 610 17.6 Word Tearing......Page 612 17.7 Non-atomic Treatment of......Page 613 17.8.1 Wait......Page 614 17.8.2 Notificatio......Page 615 17.8.4 Interactions of Waits, Notification and Interruptio......Page 616 17.9 Sleep and Yield......Page 617 18.1 The Grammar of the Java Programming Language......Page 619 A......Page 631 B......Page 634 C......Page 635 D......Page 641 E......Page 643 F......Page 647 G......Page 649 I......Page 650 K......Page 654 L......Page 655 M......Page 656 N......Page 659 O......Page 661 P......Page 662 R......Page 665 S......Page 666 T......Page 670 U......Page 679 V......Page 680 Z......Page 681 Colophon......Page 683
Written by the inventors of the technology, The JavaTM Language Specification, Third Edition , is the definitive technical reference for the JavaTM programming language. If you want to know the precise meaning of the language's constructs, this is the source for you.
The book provides complete, accurate, and detailed coverage of the Java programming language. It provides full coverage of all new features added since the previous edition, including generics, annotations, asserts, autoboxing, enums, for-each loops, variable arity methods, and static import clauses.
The authoritative source for high-level information about the language and a basic reference for all serious Java programmers.
Written by the inventors of the language, this book provides the mostauthoritative technical reference for all serious programmers seeking to sharpenand hone their Java programming skills. As the definitive reference book, itprovides programmers with complete, precise, and detailed coverage of theentire Java programming language and defines the current state and evolutionof the language. Java 1.5 aka "Tiger"( and soon to be Java 5.0) will be releasedin the fall of 2004, and this reference supplies coverage on the most recentupdates to the Java language including generics, a tool developers have beenasking to be included in the language for years.