AP® Computer Science A glossary

Precondition

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

A condition that must be true just before a method runs for it to behave as expected. The method is not expected to check it.

Appears in the course and exam description (CED): 1.8.A.2

If a call breaks a precondition, the method’s behavior is not guaranteed. Meeting the precondition is the caller’s job. Example: Precondition: count > 0.

Learn it properly, with a checkpoint 1.8 Documentation with Comments

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