Unit 02 · overview
Unit 2: Variables, Types, and Numeric Behavior
Java makes you state what kind of value a variable can hold. That constraint is not pointless ceremony. It lets the compiler reject impossible relationships early and gives numeric operations precise behavior.
This unit focuses on the places where beginner intuition often disagrees with the language:
intversusdouble;- integer division;
- widening and narrowing conversions;
- overflow;
- floating-point precision;
- choosing a representation that fits the problem.
By the end, you should stop treating a number as "just a number" and begin asking what representation Java is actually using.