Java - Review Data Type and Let's do Conditional Logic and Looping
Summary
Implicit Type Conversion
- Widening conversions are automatic
- Mixed integer sizes: Uses largest integer in equation
- Mixed floating point sizes: Uses double
- Mixed integer and floating point: Uses largest floating point in equation
Explicit Type Conversion
- Can perform widening and narrowing
- Floating point to integer drop fractions
- Use caution with narrowing conversion
- Integer to floating point can lose precision
What if the room value is Zero?