2018-02-02

2018-02-03  本文已影响0人  hothome99

Summary of Operators

The following quick reference summarizes the operators supported by the Java programming language.

Simple Assignment Operator

= Simple assignment operator

Arithmetic Operators

/ Division operator
% Remainder operator

Unary Operators

++ Increment operator; increments
a value by 1
-- Decrement operator; decrements
a value by 1
! Logical complement operator;
inverts the value of a boolean

Equality and Relational Operators

== 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)

Type Comparison Operator

instanceof Compares an object to
a specified type

Bitwise and Bit Shift Operators

~ Unary bitwise complement
<< Signed left shift

 Signed right shift
Unsigned right shift

& Bitwise AND
^ Bitwise exclusive OR
| Bitwise inclusive OR

上一篇 下一篇

猜你喜欢

热点阅读