Variables, Types, and Operations
In Java the type has to be clear from the start. We go through the primitive types, then integers and floats in more depth.
Articles
1
Data Types in the Java Language
A data type is an attribute that sticks to a piece of data and decides how that data can be treated.
2
Getting to Know the Integer Data Type in Java
Integer, as the name suggests, is a data type that only holds whole numbers (negative, zero, and positive).
3
Getting to Know the Float Data Type in Java
Float, or floating point, is a data type that holds decimal and fractional number literals.
4
Java Operators: the Average That Came Out a Whole Number
Three scores, one division, and the average prints as 82. Both operands are int, so the fraction is cut off, and the obvious cast prints 82.0 without fixing anything.