AP Computer Science A Vocabulary

0.0(0)
Studied by 19 people
0%Exam Mastery
Build your Mastery score
multiple choiceAP Practice
Supplemental Materials
call kaiCall Kai
Card Sorting

1/177

flashcard set

Earn XP

Description and Tags

Last updated 7:39 PM on 3/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

178 Terms

1
New cards

@Override Annotation

An optional annotation placed before a method to indicate that it is intended to override a method in the superclass; causes a compile-time error if no matching superclass method exists.

2
New cards

Abstract Class

A class declared with the abstract keyword that cannot be instantiated directly and may contain both abstract methods (no body) and concrete methods (with body).



Example: "abstract class Shape { abstract double area(); } defines a class that cannot be used directly."

3
New cards

Abstract Method

A method declared with the abstract keyword and no body in an abstract class, forcing every non-abstract subclass to provide its own implementation.



Example: "public          double area(); must be implemented by every non-abstract subclass."

4
New cards

Abstraction

The process of hiding implementation details and exposing only the essential features of an object, reducing complexity and isolating impact of change.

5
New cards

Access Modifier

A keyword that controls the visibility and accessibility of a class, constructor, variable, or method; includes public, private, and protected.

6
New cards

Accumulator

A variable used inside a loop to build up a running total or combine values over multiple iterations.



Example: "int sum = 0; sum += arr[i]; — here sum is the          that collects the total."

7
New cards

add(int index, Object element)

An ArrayList method that inserts a specified element at a designated index, shifting subsequent elements to the right.

8
New cards

add(Object o)

An ArrayList method that appends a specified element to the end of the list.

9
New cards

Algorithm

A step-by-step set of instructions for solving a problem or accomplishing a task.

10
New cards

Arithmetic Operator

An operator that performs mathematical operations: +, -, *, /, % (modulo).

11
New cards

ArithmeticException

A runtime exception thrown when an arithmetic error occurs, most commonly integer division by zero.

12
New cards

Array

A fixed-size data structure that stores multiple elements of the same data type in contiguous memory, accessed by integer indices starting at 0.



Example: "int[] scores = new int[10]; declares an          that holds ten integers."

13
New cards

Array Declaration

Specifying the data type and variable name for an array using square brackets.



Example: "int[] arr; is an          for an integer array."

14
New cards

Array Initialization

Allocating memory for an array using the new keyword and specifying its size.



Example: "arr = new int[5]; performs          by reserving space for five integers."

15
New cards

Array Length

The number of elements an array can hold, accessed via the .length field (not a method call).



Example: "scores.length returns the          of the scores array."

16
New cards

Array Literal

Directly assigning values to an array using curly brace notation without using new.



Example: "int[] arr = {1, 2, 3, 4, 5}; is an          that creates and fills the array at once."

17
New cards

Array Traversal

Accessing each element of an array in sequence, typically using a loop from index 0 to length-1.

18
New cards

ArrayIndexOutOfBoundsException

A runtime exception thrown when an attempt is made to access an array element at an invalid index (less than 0 or greater than or equal to length).

19
New cards

ArrayList

A resizable array from the java.util package that dynamically grows or shrinks as elements are added or removed; stores object references, not primitives.



Example: "ArrayList<String> list = new ArrayList<>(); creates an          of strings."

20
New cards

Assignment

Using the = operator to give a variable a value (initial or updated).



Example: "x = 10; is an          that stores the value 10 into x."

21
New cards

Autoboxing

The automatic conversion of a primitive type (like int) to its corresponding wrapper class object (like Integer) when added to a collection.

22
New cards

Base Case

The condition in a recursive method that stops the recursion and returns a value without making another recursive call; prevents infinite recursion.

23
New cards

Behavior

What an object can do; represented by the methods defined in its class.

24
New cards

Binary Search

An efficient searching algorithm that repeatedly divides a sorted array in half, comparing the target to the middle element to narrow the search space; O(log n) time complexity.

25
New cards

boolean

A primitive data type that can only store one of two values: true or false.



Example: "         passed = true; declares a variable that holds a true/false value."

26
New cards

Boolean Expression

An expression that evaluates to either true or false, typically using relational and logical operators.



Example: "x > 5 && x < 10 is a          that checks if x is between 5 and 10."

27
New cards

Bubble Sort

A simple sorting algorithm that repeatedly compares and swaps adjacent elements that are in the wrong order until the array is sorted; O(n²) time complexity.

28
New cards

Call Stack

A data structure that tracks active method invocations; each method call adds a new frame, and each return removes one. Recursive calls grow the stack until a base case is reached.

29
New cards

catch Block

A block of code that handles a specific type of exception thrown within the associated try block.

30
New cards

char

A primitive data type that stores a single character, enclosed in single quotes.



Example: "         grade = 'A'; stores a single letter in a character variable."

31
New cards

Class

A user-defined blueprint or template from which objects are created; defines the state (fields) and behavior (methods) shared by all instances of that type.



Example: "public          Dog { … } defines the blueprint for all Dog objects."

32
New cards

Column Index

The second index used to access an element in a 2D array, representing the column position (e.g., matrix[row][col]).

33
New cards

Comparable Interface

A built-in Java interface with a compareTo() method that allows objects of a class to be compared for natural ordering; required for sorting with Arrays.sort() on custom objects.

34
New cards

Compile-Time Polymorphism

Polymorphism resolved by the compiler before the program runs, achieved through method overloading.

Also called: Static polymorphism

35
New cards

Compiler

A program that translates Java source code into bytecode; catches syntax errors before execution.

36
New cards

Compound Assignment Operator

An operator that combines an arithmetic operation with assignment; includes +=, -=, *=, /=, %=.



Example: "x += 5 is a          equivalent to x = x + 5."

37
New cards

Conditional Statement

A control structure that executes different blocks of code depending on whether a condition evaluates to true or false.

Also called: Selection statement

38
New cards

Constant

A variable declared with final that cannot be reassigned after initialization.



Example: "final int MAX = 100; declares a          whose value can never change."

39
New cards

Constructor

A special method with the same name as the class that is called when a new object is created; initializes the object's fields. Has no return type.



Example: "public Dog(String name) { this.name = name; } is a          that sets the dog's name."

40
New cards

Data Hiding

The OOP principle of restricting direct access to an object's internal state by making fields private and providing public accessor methods.

Also called: Information hiding

41
New cards

Debugging

The process of finding and correcting errors (bugs) in a program.

42
New cards

Declaration

Specifying the data type and name of a variable without necessarily assigning it a value.



Example: "int count; is a          that names the variable but does not assign a value."

43
New cards

Decrement Operator (--)

An operator that decreases a variable's value by 1.



Example: "i-- applies the          to reduce i by one."

44
New cards

Default Constructor

A constructor that takes no parameters; Java provides one automatically only if no constructor is explicitly defined in the class.

45
New cards

double

A primitive data type that stores 64-bit floating-point numbers (decimal values); the default type for decimal literals in Java.



Example: "         gpa = 3.85; stores a decimal number."

46
New cards

Dynamic Method Dispatch

The mechanism by which Java determines which overridden method to execute at runtime based on the actual type of the object, not the declared reference type.

47
New cards

else Statement

A conditional block that executes when the preceding if condition is false.

48
New cards

else-if Statement

A chained conditional that checks an additional condition when the preceding if condition is false.

49
New cards

Encapsulation

The OOP principle of bundling data (fields) and the methods that operate on that data into a single class, and restricting direct access to fields using access modifiers.

Also called: Data hiding

50
New cards

Enhanced for Loop

A simplified loop syntax for iterating over all elements of an array or collection without using an index variable.

Also called: for-each loop



Example: "for (int num : array) { System.out.println(num); } uses an          to visit every element."

51
New cards

equals() Method

A method inherited from the Object class used to test whether two objects are logically equal; should be overridden in custom classes (use == only for primitives and reference identity).

52
New cards

Exception

An unexpected event or error condition that occurs during program execution, disrupting the normal flow.

53
New cards

Exception Handling

A mechanism using try, catch, and finally blocks to detect and respond to runtime errors so the program can continue or fail gracefully.

54
New cards

extends

The keyword used in Java to indicate that a class inherits from a superclass, gaining access to its non-private fields and methods.



Example: "class Cat          Animal inherits all accessible fields and methods from Animal."

55
New cards

final

A non-access modifier that makes a variable constant (cannot be reassigned), a method non-overridable, or a class non-inheritable.



Example: "         double PI = 3.14159; declares a constant that cannot change."

56
New cards

finally Block

A block of code that executes after the try and catch blocks regardless of whether an exception was thrown; used for cleanup operations.

57
New cards

for Loop

A loop with a built-in initialization, condition, and update expression, typically used when the number of iterations is known in advance.



Example: "for (int i = 0; i < 10; i++) { … } is a          that runs exactly ten times."

58
New cards

Generics

A Java feature that allows type parameters to be specified for classes and methods, enabling type-safe collections such as ArrayList<String>.



Example: "ArrayList<Integer> uses          to restrict the list to Integer values only."

59
New cards

get(int index)

An ArrayList method that returns the element at the specified position.

60
New cards

Getter Method

A public method that retrieves (reads) the value of a private instance variable.

Also called: Accessor method



Example: "public String getName() { return name; } is a          for the name field."

61
New cards

HAS-A Relationship

A composition relationship indicating that one class contains an instance of another class as a field.



Example: "A Car          Engine means the Car class holds an Engine object as a field."

62
New cards

Identifier

The name given to a class, variable, method, or other programming element; must begin with a letter, underscore, or dollar sign and cannot be a reserved keyword.

63
New cards

if Statement

A conditional statement that executes a block of code only if a specified boolean expression is true.



Example: "if (score >= 60) { System.out.println("Pass"); } uses an          to print only when the score qualifies."

64
New cards

IllegalArgumentException

A runtime exception thrown when a method receives an argument that is inappropriate or falls outside expected bounds.

65
New cards

Immutable

An object whose state cannot be changed after creation. Java's String class is immutable — any apparent modification produces a new String object.

66
New cards

implements

The keyword used by a class to adopt an interface and provide concrete implementations for all of its abstract methods.



Example: "class Circle          Shape must define all methods declared in Shape."

67
New cards

import

A keyword used to make classes from other packages available for use in the current file without using the fully qualified name.



Example: "         java.util.ArrayList; allows ArrayList to be used without its full package name."

68
New cards

Increment Operator (++)

An operator that increases a variable's value by 1.



Example: "i++ applies the          to add one to i."

69
New cards

Index

An integer value used to access a specific element in an array or ArrayList; arrays in Java are zero-indexed (first element is at index 0).

70
New cards

IndexOutOfBoundsException

A runtime exception thrown when an index used to access an array, String, or ArrayList is outside valid bounds.

71
New cards

Infinite Loop

A loop whose condition never becomes false, causing the program to execute the loop body indefinitely.

72
New cards

Inheritance

A mechanism allowing one class (subclass) to acquire the fields and methods of another class (superclass) using the extends keyword; models an IS-A relationship and enables code reuse.



Example: "class Dog extends Animal uses          so Dog automatically has Animal's fields and methods."

73
New cards

Inheritance Hierarchy

The tree structure formed by classes and their parent/child relationships through inheritance.

74
New cards

Initialization

Assigning an initial value to a variable at the time of declaration.



Example: "int count = 0; performs          by giving count a starting value."

75
New cards

Insertion Sort

A sorting algorithm that builds a sorted subarray one element at a time by inserting each new element into its correct position; O(n²) worst case, O(n) best case.

76
New cards

Instance

A specific object created from a class template using the new keyword.



Example: "new Car() creates an          of the Car class."

77
New cards

Instance Variable

A non-static variable declared inside a class but outside any method; each object has its own separate copy.

Also called: Field, attribute

78
New cards

instanceof

An operator that tests whether an object is an instance of a specific class or interface; returns a boolean value.



Example: "if (animal          Dog) checks whether animal currently refers to a Dog object."

79
New cards

Instantiation

The act of creating a specific object (instance) of a class using the new keyword.

80
New cards

int

A primitive data type that stores whole numbers (integers) from -2,147,483,648 to 2,147,483,647; the default type for integer literals in Java.



Example: "         score = 95; declares a whole-number variable."

81
New cards

Integer Division

Division between two int values that truncates any fractional part and returns an integer result.



Example: "7 / 2 gives 3 because          discards the decimal portion."

82
New cards

Interface

A completely abstract type in Java that defines a contract of method signatures (and constants); a class uses implements to adopt an interface and must provide concrete implementations for all its methods.



Example: "         Runnable { void run(); } defines a contract any implementing class must fulfill."

83
New cards

IS-A Relationship

An inheritance relationship indicating that a subclass object is a type of its superclass; established with extends or implements.



Example: "A Dog          Animal means every Dog object can be used wherever an Animal is expected."

84
New cards

Iteration

The process of repeating a block of code; each single repetition is called an iteration.

85
New cards

JVM (Java Virtual Machine)

The runtime engine that executes Java bytecode, enabling Java's "write once, run anywhere" principle by abstracting over the underlying hardware and OS.

86
New cards

Keyword

A reserved word in Java that has a predefined meaning and cannot be used as an identifier.



Example: "class, int, public, and return are each a          that Java reserves for its own use."

87
New cards

Linear Search

A searching algorithm that sequentially checks each element from beginning to end until the target is found or the list is exhausted; works on unsorted data with O(n) time complexity.

Also called: Sequential search

88
New cards

Local Variable

A variable defined within a method, constructor, or block; only accessible within that scope and not initialized automatically.

89
New cards

Logic Error

A program error where the code compiles and runs without crashing but produces incorrect results due to flawed logic.

90
New cards

Logical Operator

An operator that combines boolean expressions; includes && (AND), || (OR), ! (NOT).

91
New cards

Loop

A control structure that repeatedly executes a block of code until a specified condition is no longer true.

92
New cards

Math Class

A built-in Java class providing static mathematical methods and constants such as Math.abs(), Math.sqrt(), Math.pow(), and Math.random().

93
New cards

Math.abs()

A static Math method that returns the absolute value of a number.

94
New cards

Math.max(a, b)

A static Math method that returns the larger of two values.

95
New cards

Math.min(a, b)

A static Math method that returns the smaller of two values.

96
New cards

Math.pow(base, exp)

A static Math method that returns the value of base raised to the power of exp as a double.

97
New cards

Math.random()

A static Math method that returns a pseudorandom double value between 0.0 (inclusive) and 1.0 (exclusive).

98
New cards

Math.sqrt()

A static Math method that returns the positive square root of a number as a double.

99
New cards

Merge Sort

A divide-and-conquer sorting algorithm that recursively divides the array into halves, sorts each half, and merges them back in sorted order; O(n log n) time complexity in all cases.

100
New cards

Method

A named block of statements inside a class that performs a specific task and can optionally return a value to the caller.



Example: "public int add(int a, int b) { return a + b; } is a          that computes a sum."

Explore top notes

note
LIGHT: Geometric Optics
Updated 1289d ago
0.0(0)
note
arguments and fallacies
Updated 1255d ago
0.0(0)
note
APES 4.9 El Nino and La Nina
Updated 1142d ago
0.0(0)
note
BotanyRoots
Updated 1297d ago
0.0(0)
note
1st ISLAMIC COMMUNITY (PART 1)
Updated 1295d ago
0.0(0)
note
Unit 7
Updated 331d ago
0.0(0)
note
LIGHT: Geometric Optics
Updated 1289d ago
0.0(0)
note
arguments and fallacies
Updated 1255d ago
0.0(0)
note
APES 4.9 El Nino and La Nina
Updated 1142d ago
0.0(0)
note
BotanyRoots
Updated 1297d ago
0.0(0)
note
1st ISLAMIC COMMUNITY (PART 1)
Updated 1295d ago
0.0(0)
note
Unit 7
Updated 331d ago
0.0(0)

Explore top flashcards

flashcards
Mesopotamian Empires
40
Updated 1213d ago
0.0(0)
flashcards
SPANISHOCAB
45
Updated 1062d ago
0.0(0)
flashcards
Tussenstop 4
53
Updated 1027d ago
0.0(0)
flashcards
Book A Final
44
Updated 329d ago
0.0(0)
flashcards
unit 3: republic act 7719
111
Updated 1135d ago
0.0(0)
flashcards
Phys II- Exam 1 TQs
190
Updated 246d ago
0.0(0)
flashcards
Mesopotamian Empires
40
Updated 1213d ago
0.0(0)
flashcards
SPANISHOCAB
45
Updated 1062d ago
0.0(0)
flashcards
Tussenstop 4
53
Updated 1027d ago
0.0(0)
flashcards
Book A Final
44
Updated 329d ago
0.0(0)
flashcards
unit 3: republic act 7719
111
Updated 1135d ago
0.0(0)
flashcards
Phys II- Exam 1 TQs
190
Updated 246d ago
0.0(0)