Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
Kinds of Conversion

Java Language Specification, Version Java SE 21 Edition
5.1. Kinds of Conversion

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-5.html#jls-5.1

5 Documented Misconceptions

Misconception
NoCastIfSameSize
If a variable is at least as big (bit-width) as a value, then no cast is needed to a assign the value to the variable
Misconception
NoImplicitWidening
Smaller types are never automatically converted into bigger ones without an explicit cast
Misconception
NumericToBooleanCoercion
Numeric types can be coerced to boolean
Misconception
ReferenceToBooleanCoercion
Every reference type can be coerced to boolean
Misconception
ReferenceToIntegerConversion
One can cast between references and ints

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors