2018-02-02

Summary of Operators

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

Simple Assignment Operator

= Simple assignment operator

Arithmetic Operators

  •  Additive operator (also used
      for String concatenation)
    
  •   Subtraction operator
    
  •   Multiplication operator
    

/ Division operator
% Remainder operator

Unary Operators

  •   Unary plus operator; indicates
      positive value (numbers are 
      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

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

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,162評(píng)論 0 23
  • 初來簡(jiǎn)書,在此記錄分享一些前端技術(shù)知識(shí),多多支持 初來乍到 2015 2015年畢業(yè)于北京北四環(huán)下,陰差陽(yáng)錯(cuò)干起了...
    bestvist閱讀 996評(píng)論 2 1
  • 不知道該如何描述和表達(dá)自己今天的心情。 早晨快到11點(diǎn),Olive 電話給我,問我吃午飯前是否可以去見她,如果可能...
    境外閱讀 689評(píng)論 1 1
  • 作為一個(gè)現(xiàn)代人,沒人打開淘寶和京東刷一下有什么需要的商品已經(jīng)成了生活中不可或缺的一部分。可是對(duì)于賣家來說,有一些商...
    魯幫主20閱讀 1,253評(píng)論 0 0
  • 充實(shí)的一周 每天七點(diǎn)半起床 開始晨誦 星期一二三四上午要寫語文和英語 星期五六日早上學(xué)拉丁舞 下午要跳繩五百個(gè) 然...
    橄欖樹偌希閱讀 384評(píng)論 0 1

友情鏈接更多精彩內(nèi)容