AP® Computer Science A glossary
int
Also called: integer type
Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods
The primitive type for integers, such as -4, 0 or 120. An int is stored in 4 bytes.
Appears in the course and exam description (CED): 1.2.B.11.5.B.2
An int value is an integer. Arithmetic with two int values gives an int, so 7 / 2 is 3. Every int lies between Integer.MIN_VALUE and Integer.MAX_VALUE.
int lives = 3;
System.out.println(lives * 2);
System.out.println(7 / 2);
Output:
6
3 Learn it properly, with a checkpoint 1.2 Variables and Data Types