diff --git a/src/boolean/not.md b/src/boolean/not.md index 925d5f8..c93f23a 100644 --- a/src/boolean/not.md +++ b/src/boolean/not.md @@ -13,3 +13,15 @@ So in this case, I have stuck to my calorie limit if there are _not_ Oreos in th | ---------------- | ------------------- | | false | true | | true | false | + +```java,no_run +boolean isLoggedIn = false; +boolean isGuest = !isLoggedIn; +``` + +Now in this case, if user is _not_ logged in he is a guest. + +| isLoggedIn | isGuest | +| ---------- | ------- | +| false | true | +| true | false |