How to Implement a Class on the AP CSA Exam

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Class

A blueprint for creating objects in Java, containing fields (attributes) and methods (behaviors).

2
New cards

Object

An instance of a class, representing a specific entity with state and behavior.

3
New cards

Field (Instance Variable)

A variable defined in a class to store data for each object. Typically private for encapsulation.

4
New cards

Constructor

A special method used to initialize objects, having the same name as the class and no return type.

5
New cards

Accessor Method (Getter)

A method that retrieves the value of a private field.

6
New cards

Mutator Method (Setter)

A method that modifies the value of a private field, often with input validation.

7
New cards

Encapsulation

The principle of restricting access to a class's fields by using private fields and public methods.

8
New cards

Method

A block of code within a class that performs a specific task when called.

9
New cards

this Keyword

A reference to the current object, often used to distinguish between fields and parameters with the same name.

10
New cards

Overloading

Defining multiple methods with the same name but different parameter lists within the same class.

11
New cards

toString Method

A method that returns a string representation of an object, often used for debugging or output.

12
New cards

Edge Case

An unusual or extreme input that tests the robustness of a program, such as negative numbers or null values.

13
New cards

Private Access Modifier

A keyword that restricts access to a field or method to within the class where it is declared.

14
New cards

Public Access Modifier

A keyword that allows access to a field or method from anywhere in the program.

15
New cards

Return Type

Specifies the data type of the value a method will return, or void if no value is returned.

16
New cards

Parameter

A variable in a method or constructor declaration used to pass values into the method or constructor.

17
New cards

Default Constructor

A no-argument constructor provided by Java if no other constructors are defined in the class.

18
New cards

Null

A special value representing an object reference that does not point to any object.

19
New cards

Static Method

A method associated with the class rather than any instance, called using the class name.

20
New cards

Instance Method

A method that operates on an instance of a class, requiring an object to be called.