0

Searching on the documentation of Node in JavaFX i walked through this method:

     /**
     * Set all dirty bits
     */
    private void setDirty() {
        dirtyBits = ~0;
    }

   //where dirtyBits is an int

I have searched on search engine but can't find what ~ means?

GOXR3PLUS
  • 6,877
  • 9
  • 44
  • 93
  • 2
    There is a problem with search engines and computer programming operators. Most search engines (Google, notably) remove punctuation from searches, thus you can't look for operators. You might want to search using [Symbolhound](http://symbolhound.com/). – RealSkeptic Sep 01 '16 at 07:31
  • @RealSkeptic I agree, searching for "java operators" is very hard and almost impossible to find pages like http://www.tutorialspoint.com/java/java_basic_operators.htm. – Tom Sep 01 '16 at 07:34
  • @RealSkeptic http://symbolhound.com/?q=what+%7E+means+in+Java%3F bring no results again.I didn't knew that search engines remove the punctuation (+1). – GOXR3PLUS Sep 01 '16 at 07:36
  • 1
    @Tom you are being sarcastic, but beginners usually have to understand it's actually an *operator* to search for the word "operator". Another way is to search for "java tilde", which Google understands, but there are many people who don't know the *name* of the `~` character. So really, there is no place for sarcasm here. – RealSkeptic Sep 01 '16 at 07:37

1 Answers1

3

Is a the unary bitwise operator, changes in binary each 0 by 1 and each 1 by 0

From documentation

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.


As stated in comments, problem of this is not lack of effort by user either documentation but problem of the search engines like google because remove punctuation symbols (like ~) when searching.

For people like me, non English native speakers is a real problem sometimes to find the correct words. In order to avoid this, in this case, you can search java bitwise operator for further info.

Community
  • 1
  • 1
joc
  • 1,336
  • 12
  • 31