AP® Computer Science A glossary

Arithmetic operators

Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods

The five operators for arithmetic: + (addition), - (subtraction), * (multiplication), / (division) and % (remainder).

Appears in the course and exam description (CED): 1.3.C.2

An operation with two int values evaluates to an int. An operation with at least one double evaluates to a double.

System.out.println(17 / 5);
System.out.println(17 % 5);
System.out.println(17 / 5.0);

Output:

3
2
3.4
Learn it properly, with a checkpoint 1.3 Expressions and Output

Related terms

Was this page helpful?

No names are ever shown, and every public comment is checked by us first. Please do not include personal details. To get a reply, email [email protected].

↑ Top

Enlarged view of the selected figure