AP® Computer Science A glossary
Inclusive and exclusive
Also called: inclusive, exclusive
Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods
Describes an endpoint of a range: inclusive means the value can occur, exclusive means it cannot.
Appears in the course and exam description (CED): 1.11.A.3
Math.random() has an inclusive lower endpoint (0.0) and an exclusive upper endpoint (1.0). The pattern (int) (Math.random() * 6) + 1 gives 1 to 6, both inclusive.