Example: confidence

The Java® Language Specification - Oracle

The Java LanguageSpecificationJava SE 8 EditionJames GoslingBill JoyGuy SteeleGilad BrachaAlex Buckley2015-02-13 Specification : JSR-337 Java SE 8 Release Contents (" Specification ")Version: 8 Status: Maintenance ReleaseRelease: March 2015 Copyright 1997, 2015, Oracle America, Inc. and/or its Oracle Parkway, Redwood City, California 94065, rights and Java are registered trademarks of Oracle and/or its affiliates. Other names maybe trademarks of their respective Specification provided herein is provided to you only under the Limited License Grantincluded herein as Appendix A. Please see Appendix A, Limited License Maurizio, with deepest of ContentsPreface to the Java SE 8 of the to Predefined Classes and Lexical Syntactic Notation103 Lexical Elements and Sequences for Character and String Null Java Language Specificationvi4 Types, Values, and Kinds of Types and Types and Types and Types, Formats, and boolean Type and boolean Types and Class Class Reference Types Are the Arguments of Parameterized

Feb 13, 2015 · v Table of Contents Preface to the Java SE 8 Edition xix 1 Introduction 1 1.1 Organization of the Specification 2 1.2 Example Programs 6 1.3 Notation 6 1.4 …

Tags:

  Oracle, Specification

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of The Java® Language Specification - Oracle

1 The Java LanguageSpecificationJava SE 8 EditionJames GoslingBill JoyGuy SteeleGilad BrachaAlex Buckley2015-02-13 Specification : JSR-337 Java SE 8 Release Contents (" Specification ")Version: 8 Status: Maintenance ReleaseRelease: March 2015 Copyright 1997, 2015, Oracle America, Inc. and/or its Oracle Parkway, Redwood City, California 94065, rights and Java are registered trademarks of Oracle and/or its affiliates. Other names maybe trademarks of their respective Specification provided herein is provided to you only under the Limited License Grantincluded herein as Appendix A. Please see Appendix A, Limited License Maurizio, with deepest of ContentsPreface to the Java SE 8 of the to Predefined Classes and Lexical Syntactic Notation103 Lexical Elements and Sequences for Character and String Null Java Language Specificationvi4 Types, Values, and Kinds of Types and Types and Types and Types, Formats, and boolean Type and boolean Types and Class Class Reference Types Are the Arguments of Parameterized and Constructors of Parameterized among Primitive among Class and Interface among Array Upper Types Are of Primitive of Reference of Values of , Classes.

2 And Interfaces885 Conversions and of Primitive Primitive and Narrowing Primitive Reference Reference Conversion105 The Java Language Set Type Casts and Unchecked Casts at Run Numeric Numeric and of a and the Meaning of a Classification of a Name According to of Contextually Ambiguous of Package Package Package of of Type Type Type of Expression Expression Expression of Method Method on protected to a protected Access to a protected Qualified Names and Canonical Members175 The Java Language Support for of a Level Type Classes and Type Classes and Enclosing and Body and Member References During Field Body242 The Java Language , Overriding, and (by Instance Methods) (by Class Methods) in Overriding and Methods with Type Member Type Type of a Constructor Instantiation of a Body Interfaces and Type and Body and Member (Constant) of Fields in and (by Instance Methods)

3 In Methods with Method Body293 The Java Language Type Type for Annotation Type Annotation Annotation Annotations May Annotations of the Same Store Objects for Array of Characters Is Not a Kinds and Causes of Kinds of Causes of Checking of Analysis of Analysis of Handling of an Exception352 The Java Language Virtual Machine the Class Test: Verify, Prepare, (Optionally) Test: Execute of Classes and Loading of Classes and of the Binary of a Class or Interface of Symbolic of Classes and Initialization Initialization of New Class of Class with the Memory of Classes and Exit37913 Binary Form of a Binary Compatibility Is and Is of of and Type Body and Member to Members and Fields and static Constant and Constructor and Constructor Type and Constructor Formal Result Methods404 The Java Language and Constructor and Constructor and Constructor of of Type Method of Annotation Types40914 Blocks and and Abrupt Completion of Class Variable Declaration Variable Declarators and of Local

4 Variable Empty if if-then if-then-else assert switch while Completion of while do Completion of do for basic for of for of for Completion of for enhanced for break continue return throw synchronized try statement447 The Java Language of of try-finally and , Denotation, and of of an and Run-Time and Abrupt Completion of Left-Hand Operand Operands before Respects Parentheses and Lists are Evaluated Order for Other Instance Creation the Class being Enclosing the Constructor and its Evaluation of Class Instance Class Creation and Access Creation Evaluation of Array Creation Access Evaluation of Array Access Access Access Using a Superclass Members using Invocation Step 1: Determine Class or Interface Step 2: Determine Method Potentially Applicable Methods515 The Java Language 1: Identify Matching Arity Methods Applicableby Strict 2: Identify Matching Arity Methods Applicableby Loose 3.

5 Identify Methods Applicable by Variable the Most Specific Invocation Step 3: Is the Chosen Method Appropriate? Evaluation of Method Target Reference (If Necessary) Accessibility of Type and Method to Frame, Synchronize, Transfer Reference Declaration of a Method of a Method Evaluation of Method Increment Operator ++ Decrement Operator Increment Operator ++ Decrement Operator Plus Operator + Minus Operator Complement Operator ~ Complement Operator ! Operator * Operator Operator % Concatenation Operator + Operators (+ and -) for Numeric Comparison Operators <, <=, >, and >= Comparison Operator Equality Operators == and != Equality Operators == and != Equality Operators == and !

6 = and Logical Bitwise Operators &, ^, and |575 The Java Language Logical Operators &, ^, and | Operator && Operator || Operator ? Conditional Conditional Conditional Assignment Operator = Assignment of a Lambda Evaluation of Lambda Expressions61216 Definite Assignment and Constant Operator && Operator || Complement Operator ! Operator ? Operator ? Expressions of Type ++ and Assignment and Class Declaration Variable Declaration Part of for Part of for , continue, return, and throw Statements632 The Java Language Assignment and Assignment and Array Assignment and Enum Assignment and Anonymous Assignment and Member Assignment and Static Assignment, Constructors, and Instance Initializers63617 Threads and Sets and of Waits, Notification.

7 And and and Program and Causality Behavior and Nonterminating Field of final final Fields During Modification of final Treatment of double and long66618 Type and Compatibility Compatibility Equality Exception Pairs of Bounds682 The Java Language Involving Capture of Applicability Type Interface Parameterization Specific Method Inference69519 Syntax699 Index725 ALimited License Grant765xixPreface to the Java SE 8 EditionIN 1996, James Gosling, Bill Joy, and Guy Steele wrote for the First Edition ofThe Java Language Specification :"We believe that the Java programming Language is a mature Language , ready forwidespread use. Nevertheless, we expect some evolution of the Language in theyears to come.

8 We intend to manage this evolution in a way that is completelycompatible with existing applications."Java SE 8 represents the single largest evolution of the Java Language in its relatively small number of features - lambda expressions, method references, andfunctional interfaces - combine to offer a programming model that fuses the object-oriented and functional styles. Under the leadership of Brian Goetz, this fusionhas been accomplished in a way that encourages best practices - immutability,statelessness, compositionality - while preserving "the feel of Java" - readability,simplicity, , the libraries of the Java SE platform have co-evolved with the Javalanguage. This means that using lambda expressions and method references torepresent behavior - for example, an operation to be applied to each element ina list - is productive and performant "out of the box".

9 In a similar fashion, theJava Virtual Machine has co-evolved with the Java Language to ensure that defaultmethods support library evolution as consistently as possible across compile timeand run time, given the constraints of separate to add first-class functions to the Java Language have been around sincethe 1990s. The BGGA and CICE proposals circa 2007 brought new energy tothe topic, while the creation of Project Lambda in OpenJDK circa 2009 attractedunprecedented levels of interest. The addition of method handles to the JVM inJava SE 7 opened the door to new implementation techniques while retaining"write once, run anywhere." In time, Language changes were overseen by JSR 335,Lambda Expressions for the Java Programming Language , whose Expert Groupconsisted of Joshua Bloch, Kevin Bourrillion, Andrey Breslav, R mi Forax, DanHeidinga, Doug Lea, Bob Lee, David Lloyd, Sam Pullara, Srikanth Sankaran, andVladimir Language design typically involves grappling with degrees ofcomplexity utterly hidden from the Language 's users.

10 (For this reason, it is oftencompared to an iceberg: 90% of it is invisible.) In JSR 335, the greatest complexityPREFACE TO THE JAVA SE 8 EDITION xxlurked in the interaction of implicitly typed lambda expressions with overloadresolution. In this and many other areas, Dan Smith at Oracle did an outstandingjob of thoroughly specifying the desired behavior. His words are to be foundthroughout this Specification , including an entirely new chapter on type initiative in Java SE 8 has been to enhance the utility of annotations, oneof the most popular features of the Java Language . First, the Java grammar hasbeen extended to allow annotations on types in many Language constructs, formingthe basis for novel static analysis tools such as the Checker Framework.


Related search queries