Expressions
int cadence = 0;
anArray[0] = 100;
System.out.println("Element 1 at index 0: " + anArray[0]);
int result = 1 + 2; // result is now 3
if (value1 == value2)
System.out.println("value1 == value2"); - Is a construct made up of variables, operators, and method invocations, which are constructed according to the syntax of the language, that evaluates to a single value.
- The Java programming language allows you to construct compound expressions from various smaller expressions as long as the data type required by one part of the expression matches the data type of the other.
- If you don't explicitly indicate the order for the operations to be performed, the order is determined by the precedence assigned to the operators in use within the expression.
Related concepts
→
Expressions
→
- The Unary Operators
- The Conditional Operators
- The switch Statement
- The while Statement
- The do-while Statement
- The for Statement
- The return Statement
- Statements, Expressions, and Blocks
- Statements
- Object: Creating Objects
- Anonymous Classes
- The Collectors.groupingBy Method
- Lambda Expressions
- Lambda Expressions: Accessing Local Variables of the Enclosing Scope
- Using Objects: Referencing an Object's Fields
Semantic portal