What is ++== in Java?

  • A+
  1. Searched this site, found no reference.
  2. Test code:

    int[] test = {0, 1, 2, 3}; System.out.println("test1[3] ++== 0 is " + (test[3] ++== 0)); 
  3. Result:

test1[3] ++== 0 is false

So it must be some sort of logical operator but I have not been able to find any documentation. Searching the Internet yielded no reference.

Please help? Thanks in advance.


The way the text is presented looks like it would be a special case ++==, but in fact you should read it as follows:

test[3]++ == 0

Basically, the result of test[3]++ will be compared (i.e ==) with 0.

And this basically reads as (test[3]=3) == 0, which is false.

The ++ is a postfix operator which is shortcut for value = value + 1.

The == is a comparison between two values.

The text is just badly formatted, that's all.


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: