AP® Computer Science A glossary

Instance method

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

A method called on an object of the class, using the object's name and the dot operator.

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

An instance method acts on one particular object. It needs an object: Plant.grow(5) does not compile.

Plant p = new Plant("Fern", 30);
p.grow(5);
System.out.println(p.getHeight());

Output:

35
Learn it properly, with a checkpoint 1.14 Calling Instance Methods

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