Summary of Operators (The Java™ Tutorials - Learning The Java Language - Language Basics)
Summary of Operators (The Java™ Tutorials - Learning The Java Language - Language Basics)
Search
The Java™ Tutorials Hide TOC
Language Basics
Variables « Previous • Trail • Next » Home Page > Learning the Java Language > Language Basics
Primitive Data Types
Arrays
The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no
Summary of Variables
longer available.
Questions and Exercises
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
Operators
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.
Assignment, Arithmetic,
and Unary Operators
Equality, Relational, and Summary of Operators
Conditional Operators
Bitwise and Bit Shift The following quick reference summarizes the operators supported by the Java programming language.
Operators
Summary of Simple Assignment Operator
Operators
= Simple assignment operator
Questions and Exercises
Expressions, Statements,
and Blocks
Arithmetic Operators
Questions and Exercises
+ Additive operator (also used
Control Flow Statements
for String concatenation)
The if-then and if-then- - Subtraction operator
else Statements * Multiplication operator
The switch Statement / Division operator
The while and do-while % Remainder operator
Statements
The for Statement Unary Operators
Branching Statements
Summary of Control + Unary plus operator; indicates
Flow Statements positive value (numbers are
Questions and Exercises positive without this, however)
- Unary minus operator; negates
an expression
++ Increment operator; increments
a value by 1
-- Decrement operator; decrements
a value by 1
! Logical complement operator;
inverts the value of a boolean
== Equal to
!= Not equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
Conditional Operators
&& Conditional-AND
|| Conditional-OR
?: Ternary (shorthand for
if-then-else statement)
About Oracle | Contact Us | Legal Notices | Terms of Use | Your Privacy Rights
Copyright © 1995, 2022 Oracle and/or its affiliates. All rights reserved.
Préférences en matière de cookies | Ad Choices