Booleans: where everything seems to have started.
This goes back to boolean algebra, If you say
true = true
false = false
then
not true = false
not false = true
so that means
not (not true) = not false = true
not (not false) = not true = false
which means !!done = done
you can write "not" as "!"
!true = false
!false = true
which means
!!true = !false = true
!!false = !true = false
so if done is a boolean: true or false, when its put in !!done it will always be done. for example:
boolean done = true;
!!done this will always be its initial value which is true
0 comments :
Post a Comment