Java does maths with the usual signs: + and -, * for times, / for divide. Brackets work as in school: what's inside them is done first, and otherwise * and / come before + and -.
Here's the big surprise for beginners. When both numbers are int, the answer is an int too, so the part after the decimal point is dropped, not rounded. 7 / 2 is 3. If either number is a double, you get the decimal answer.
The % sign gives the remainder after dividing (it's called "mod"). 7 % 2 is 1, because 7 is three 2s with 1 left over. It's more useful than it looks: a number is even when n % 2 is 0, and n % 10 is its last digit.
Changing a variable by some amount is so common that it has shortcuts. x += 5 means x = x + 5, and -=, *= and /= work the same way. x++ adds one and x-- takes one away.
Putting an int into a double is always safe, so Java does it for you. The other way would lose the fraction, so you must ask for it with a cast: (int) 3.99 gives 3, cutting off the fraction. To round to the nearest whole number, use Math.round.
Java
double price = 3.99;
int whole = (int) price;
System.out.println(whole);
System.out.println(Math.round(price));
int total = 17, people = 4;
System.out.println((double) total / people);
Prints
3
4
4.25
Math has the other tools you'd expect: Math.max(a, b) and Math.min(a, b) pick the bigger or smaller, Math.abs(x) drops a minus sign, Math.sqrt(x) is the square root and Math.pow(a, b) is a to the power b.
Decimals are stored in binary, so some can't be exact: 0.1 + 0.2 prints 0.30000000000000004. For everyday maths that's fine; for money, real programs count in cents with whole numbers (or use BigDecimal, in a later course).
Practice
What does this print?
System.out.println(10 / 4);
More info
Quick reference
+ - * /
Add, subtract, multiply, divide. * and / come before + and -.
7 / 2
3: dividing two ints drops the fraction.
7 % 2
1: the remainder.
x += 5; x++;
x = x + 5; x = x + 1.
(int) 3.9
3: a cast cuts off the fraction.
Math.round(x)
Rounds to the nearest whole number.
Math.max / min / abs
The bigger, the smaller, without the minus sign.
Math.sqrt / pow
Square root; a to the power b (both give doubles).