File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -912,3 +912,23 @@ Example:
912912| Size | 4 bytes | 8 bytes |
913913| Range | -1.7E38 to 1.7E38 | -1.7E308 to 1.7E308
914914
915+ ---
916+
917+
918+ # 🎯 ** boolean**
919+
920+ ** Feature** | ** Value**
921+ ---|---
922+ ** Size** | 1 bit (although JVM implementations often use 1 byte for internal representation)
923+ ** Value** | ` true ` or ` false `
924+
925+ 🔸 ** Common Compile-Time Errors with boolean**
926+
927+ ** Code** | ** Result** | ** Compiler Message (error)**
928+ ---|---|---
929+ ` boolean b = true; ` | ✅ Valid | —
930+ ` boolean b = 0; ` | ❌ Invalid | Incompatible types, found: int, required: boolean
931+ ` boolean b = True; ` | ❌ Invalid | Cannot find symbol, symbol: variable True, location: class Test
932+ ` boolean b = "true"; ` | ❌ Invalid | Incompatible types, found: java.lang.String, required: boolean
933+
934+ ---
You can’t perform that action at this time.
0 commit comments