From 6268e0945fb282a7cb113b010a2eba35c6c47e09 Mon Sep 17 00:00:00 2001 From: Abdul Karim Date: Fri, 13 Feb 2026 19:07:39 +0500 Subject: [PATCH] 6.1 Not: Add another example for better understanding --- src/boolean/not.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/boolean/not.md b/src/boolean/not.md index 925d5f80..c93f23ae 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 |