AP CSA Unit 5: Writing Classes

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

1/21

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

public

Allows access to data and methods from classes outside the declaring class.

2
New cards

private

Restricts access to data and methods to the declaring class.

3
New cards

Encapsulation

The process of hiding the implementation details of a class from the user

4
New cards

Accessor Methods

Methods used to access instance variable and object data. Also referred to as getter methods.

5
New cards

Mutator Methods

Methods used to change or manipulate instance variable or object data. Also referred to as setter methods.

6
New cards

alias

A variable that references an existing object. When the alias variable is manipulated, so is the original object, and vice versa.

7
New cards

“Has-a” Relationship

Objects are defined by having the attributes, or instance variables that they are assigned.

8
New cards

Preconditions

Conditions that must be true prior to execution in order for that code segment to behave as expected.

9
New cards

Postconditions

Conditions that must be true after the code segment is executed.

10
New cards

Accessor Method

A method that enables user to obtain information about an object’s instance and static variables.

11
New cards

toString Method

A specific accessor method that returns a String value with information about an object’s instance values. This overrides the object’s inherit toString method when an object is printed using System.out.print or System.out.println

12
New cards

Mutator Method

A method that enables user to change the value of an object’s instance and static variables.

13
New cards

object.instanceVariable

Instance variables can be accessed directly by using the reference variable name + . + the instance variable name. This only works within the class file if the instance variables are set to private.

14
New cards

Static Variables

Variables that can be accessed by all objects of a class. They are called using the class name, and can be used in static and non-static methods.

15
New cards

Static Methods

Methods that can be used directly by the class name. They cannot access instance variables or non-static methods.

16
New cards

Method Decomposition

The process of breaking down large problems into smaller problems, each with a method that defines a subproblem in the larger problem.

17
New cards

Shadowing

If two variables within the same scope have the same name, the variable with the more specific scope will be called.

18
New cards

Local Variable

A variable that is defined in a method or constructor. It only exists in the context of the method that it belongs to.

19
New cards

this Keyboard

Makes a call to the current object in a class file. Allows programmers to specify which objects and instance variables should be called.

20
New cards

ACM

Association for Computing Machinery: organization for computing professionals to provide guidance related to ethics and responsibilities.

21
New cards

System reliability

When all programs and code will work as intended.

22
New cards

Bias

Prejudice in favor of or against one thing, person, or group compared with another, usually in a way considered to be unfair.