Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
The boolean Type and boolean Values

Java Language Specification, Version Java SE 21 Edition
4.2.5. The boolean Type and boolean Values

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.2.5

5 Documented Misconceptions

Misconception
ComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to false
Misconception
MapToBooleanWithConditionalOperator
To map a boolean expression to a boolean, a conditional operator is necessary
Misconception
MapToBooleanWithIf
To map a boolean expression to a boolean, an if statement is necessary
Misconception
NumericToBooleanCoercion
Numeric types can be coerced to boolean
Misconception
ReferenceToBooleanCoercion
Every reference type can be coerced to boolean

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors