Model 1: Basic Java Programming - Arithmetic expressions and operators Flashcards
1
Q
Integer and floating point division#
There are two types of division
A
- Integer division: takes two integers and evaluates to an integer.
- Floating-point division: takes two floating-point numbers (numbers with a decimal point) and evaluates to a floating-point number.
2
Q
Typecasting operators#
A cast operator is written using parentheses and
A
the name of the target type, and precedes the value to be cast.
For example, (double) 5 yields the value 5.0.
3
Q
post-increment operator
A
x++ produces a value: the value of x before adding 1 to x.
4
Q
pre-increment operator
A
++x increments the variable first, and then produces the value