0
Sometimes I come across the exclamation mark !
before the equal character =
and I always have a question of why I have it there. Small example:
if (model.getFile() != null){
I know that if the result of model.getFile()
for true
follows the code, but what !
explicitly does?
denial: Read more
se(model.getFile() é diferente de null))
– user28595
then if you have , = read
se(model.getFile() é igual null))
– Wallace Roberto
Access one of the links marked as duplicate, it has a more detailed explanation.
– user28595
No, the opposite of
!=
is==
.– Maniero
so now I understand... and if you have only
=
?– Wallace Roberto
Ai is attribution and not comparison.
– user28595
Wallace, the exclamation mark basically reverses the value of the condition, for example:
!true
will be verified if it isfalse
, and along with the symbol of equal logic is the same:==
(is equal),!=
(is different)– RFL
interesting entedi , I tried to search before I didn’t know how to ask google :) ,Thanks.
– Wallace Roberto
@Jefferson Quesado , my dumb say that ! was interrogation , Thanks for the correction.
– Wallace Roberto