java | operator is for what?

后端 未结 8 1190
故里飘歌
故里飘歌 2021-01-25 11:14

What is the output of this java code and why ?

 int a = 5 | 3 ;
 System.out.println(a);
相关标签:
8条回答
  • 2021-01-25 11:53

    it's bitwise or:

    5 = 110
    3 = 011
    5 | 3 =
        111
    
    0 讨论(0)
  • 2021-01-25 11:53

    That's the bitwise-or operator.

    http://leepoint.net/notes-java/data/expressions/bitops.html

    0 讨论(0)
提交回复
热议问题