What does the “|” in “int style = SWT.APPLICATION_MODAL | SWT.OK;” do (and how to Google it)?

前端 未结 7 777
囚心锁ツ
囚心锁ツ 2021-01-12 23:14

I can\'t search for | in Google. If you had found it in a software source code that you are trying to interpret, you didn\'t know what it does and you couldn\'t ask other pe

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 23:46

    Bitwise OR.

    With most things, there's a bit of a learning curve. If I was learning a new language, I would assume that | was an operator, and would search for 'Java operators'.

提交回复
热议问题