Learn Java Programming - Logical Operator ! (NOT)

preview_player
Показать описание
The Logical ! (not) operator is used to perform logical complement or negation operations on boolean variables, expressions, or method return values. That sort of techobabble makes this operator seem like it must have some amazing super powers. In reality, it simply changes the evaluation of a boolean value or result from true to false or false to true. Notice I stated, "evaluation of boolean value or result". It does not change the value of the variable. That is all the ! logical operator does.
Рекомендации по теме
Комментарии
Автор

Hey, that really helped thanks for the nice explanation :)

sathvikrachakulla
Автор

your videos are amazing!!! thanx so much. you are super clear, and SO
understandable.

i have a q. on the tutorial "LOGICAL OPERATOR ! TUTORIAL" .
specificly on this part:
if(gameMode == "HARD") (you'r comparing a strings value by using a ==
operator).
i saw other code that use the (string).equals("hard") method on
strings to accomplish this same task.
whats the reason for this? and which way would you suggets?

also, in this same tutorial you did a nested "if". why didnt you use
the && operator?

once again thanx aton for your videos

jacobvolid