Initializer, or variable initializer within X is said to Interface, method, constructor, instance initializer, static Method, X, is declared strictfp, then X and any class, Interface declarations, and method declarations that contain theĮxpression.
( §5.1.13) these rules in turn depend on whetherĬonstant expression, then consider all the class declarations, This is governed by the rules of value set conversion ( §4.2.3) the value of the expression is drawnįrom. Is float or double, then there is a question as to what value set Reference or an object whose class is F itself, because final Note that an expression whose type is a class type F that isĭeclared final is guaranteed to have a value that is either a null The variable, unless heap pollution occurs.Īn expression whose type is T is always suitable for assignment to a The value stored in a variable is always compatible with the type of With the type of the expression, unless heap pollution occurs Of an expression is assignment compatible ( §5.2) The rules forĭetermining the type of an expression are explained separately below
The type of a standalone expressionĬan be determined entirely from the contents of the expression inĬontrast, the type of a poly expression may be influenced by theĮxpression's target type ( §5 ( Conversions and Contexts)). If an expression denotes a variable or a value, then the expression Result in this case the value returned by the method is quietlyĬan produce side effects, because expressions may contain embeddedĪssignments, increment operators, decrement operators, and method That is a method invocation may also invoke a method that produces a In which an expression can appear requires the expression to denote Such an expression can be used only as an Return a value, that is, a method declared void ( §15.12) that invokes a method that does not Variable of type float or double is used.Īn expression denotes nothing if and only if it is a method invocation ( §5.1.13) is applied to the result of everyĮxpression that produces a value, including when the value of a In this context, if the expressionĭenotes a variable or a value, we may speak simply of Variable, and a value is required for use in further evaluation, then Nothing (the expression is said to be void) Meanings of expressions and the rules for their evaluation. To affect the execution sequence in statements, or both. Which can be used as arguments or operands in larger expressions, or Side effects, such as assignments to variables, or for their values, Constant Expressionsĭone by evaluating expressions, either for their Run-Time Evaluation of Lambda Expressions 15.28. Boolean Logical Operators &, ^, and | 15.23. Integer Bitwise Operators &, ^, and | 15.22.2. Reference Equality Operators = and != 15.22. Boolean Equality Operators = and != 15.21.3. Numerical Equality Operators = and != 15.21.2. Type Comparison Operator instanceof 15.21. Numerical Comparison Operators, and >= 15.20.2. Additive Operators ( + and -) for Numeric Types 15.19. Run-Time Evaluation of Method References 15.14. Compile-Time Declaration of a Method Reference 15.13.2. Create Frame, Synchronize, Transfer Control 15.13. Check Accessibility of Type and Method 15.12.4.4. Compute Target Reference (If Necessary) 15.12.4.2. Run-Time Evaluation of Method Invocation 15.12.4.1. Compile-Time Step 3: Is the Chosen Method Appropriate? 15.12.4. Choosing the Most Specific Method 15.12.2.6. Phase 3: Identify MethodsĪpplicable by Variable Arity Invocation 15.12.2.5. Methods Applicable by Loose Invocation 15.12.2.4. Methods Applicable by Strict Invocation 15.12.2.3. Identify Potentially Applicable Methods 15.12.2.2. Compile-Time Step 1: Determine Class or Interface to Search 15.12.2. Accessing Superclass Members using super 15.12. Run-Time Evaluation of Array Access Expressions 15.11. Run-Time Evaluation of Array Creation Expressions 15.10.3. Array Creation and Access Expressions 15.10.1. Run-Time Evaluation of Class Instance Creation Expressions 15.9.5. Choosing the Constructor and its Arguments 15.9.4. Determining the Class being Instantiated 15.9.2. Class Instance CreationĮxpressions 15.9.1. Evaluation Order for Other Expressions 15.8. Argument Lists are Evaluated Left-to-Right 15.7.5. Evaluation Respects Parentheses and Precedence 15.7.4. Evaluate Operands before Operation 15.7.3. Normal and Abrupt Completion of Evaluation 15.7.