The title is pretty straightforward, I was just wondering if there was a difference (of any kind, performance or anything that comes to mind) between stating :
if (!(x == y)) {
}
and
if (x != y) {
}
Also, x & y are something primitives or simple objects like int, String, double ,etc. Not custom objects. But if it makes a huge difference I'd be glad to hear about it !
Considering they both check for equality, but one then uses the "opposite" afterwards, I'm not sure if it's different.
Even though this difference would be extremely minor, it arouses my curiousity !
EDIT :
The reason I thought of that (so you see exactly what I mean) was while typing this :
if (!(myTextField.length == 5))
instead of
if (mytextfield.length != 5)
So you see exactly how I meant it. String length.