Skip to content

Commit 6268e09

Browse files
6.1 Not: Add another example for better understanding
1 parent 64afc69 commit 6268e09

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/boolean/not.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ So in this case, I have stuck to my calorie limit if there are _not_ Oreos in th
1313
| ---------------- | ------------------- |
1414
| false | true |
1515
| true | false |
16+
17+
```java,no_run
18+
boolean isLoggedIn = false;
19+
boolean isGuest = !isLoggedIn;
20+
```
21+
22+
Now in this case, if user is _not_ logged in he is a guest.
23+
24+
| isLoggedIn | isGuest |
25+
| ---------- | ------- |
26+
| false | true |
27+
| true | false |

0 commit comments

Comments
 (0)