News for hackers. Stuff that matters.
Re:Twitter urges users to change passwords after computer 'g... by Freak_NL on Friday May 04, 2018 @04:54AM (#16993174)
In Java you usually use `.equals()` to test equality, or if your argument is a boolean value:

    if (myVar) {
        //
    }
Instead of `myVar == true/false`.

The accidental assignment is much less common due to the way equality is tested in Java.

Also, `null` comparisons being assigned will fail to compile (assuming var is a String here):

    TestApp.java:6: error: incompatible types: String cannot be converted to boolean
        if (var = null) {
Re:Twitter urges users to change passwords after computer 'g... by tigershark on Friday May 04, 2018 @08:15AM (#16993928)
But in Java it’s much easier to do the error of using == instead of equals if you always jump language.
Re:Twitter urges users to change passwords after computer 'g... by Freak_NL on Friday May 04, 2018 @09:49AM (#16994571)
Sure, but that is such a common mistake that all Java IDE's warn you when you try to use == for Strings and normal non-number objects.