AP® Computer Science A glossary

Class

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

The formal implementation, or blueprint, of the attributes and behaviors of an object. A class defines a reference type.

Appears in the course and exam description (CED): 1.12.A.11.7.A.1

A class describes what its objects store (attributes) and what they can do (behaviors). Many objects can be created from one class.

Plant fern = new Plant("Fern", 30);
Plant mint = new Plant("Mint", 12);
System.out.println(fern.getHeight() + " " + mint.getHeight());

Output:

30 12
Learn it properly, with a checkpoint 1.12 Objects: Instances of Classes

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