1

I found a new symbol in a Java project and want to know what does it mean?

systemUiVisibility & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

What does ~ mean in this context?

Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
Ichor de Dionysos
  • 1,107
  • 1
  • 8
  • 30

1 Answers1

9

The unary bitwise complement operator "~" inverts a bit pattern; it can be applied to any of the integral types, making every "0" a "1" and every "1" a "0".


For example, a byte contains 8 bits; applying this operator to a value whose bit pattern is "00000000" would change its pattern to "11111111".


More information is here and here.

Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142