Back to Intellij Community

DoubleLiteralMayBeFloatLiteral

java/java-impl/resources/inspectionDescriptions/DoubleLiteralMayBeFloatLiteral.html

2025.3-rc-2253 B
Original Source

Reports double literal expressions that are immediately cast to float.

Such literal expressions can be replaced with equivalent float literals.

Example:

float f = (float)1.1;

After the quick-fix is applied:

float f = 1.1f;