File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -914,6 +914,26 @@ Example:
914914
915915---
916916
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+ ---
935+ ---
936+
917937<img src =" img/JVM%2001.jpg " >
918938
919939In C/C++, this two are allow because of.
You can’t perform that action at this time.
0 commit comments