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

前端 未结 7 829
囚心锁ツ
囚心锁ツ 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:23

    | is the OR operator. Those two values are probably flags that are ints with 1 bit set, and the resulting value is which style values to use.

提交回复
热议问题