The 200-word examination instruction list
AP Computer Science A instructions tell you whether to trace existing Java, write a method, design a class or change a collection. Before coding, underline the required return type, the input guarantees and any rule about changing the supplied data.
Start with the list below, or jump to exam requirements, worked examples, the Fencing Method or practice. The list combines command words with terms that tell you how to read a question or format an answer.
Java instructions, program behaviour and code vocabulary
| No. | Instruction or term | Meaning or action |
|---|---|---|
| 1 | Implement | Write Java code that meets the given method or class specification. |
| 2 | Trace | Follow the code in execution order and record how values change. |
| 3 | Determine the output | Give exactly what the program prints, including order and spacing when relevant. |
| 4 | Return a value | Use return to hand the requested result back to the caller. |
| 5 | Modify in place | Change the existing object or collection while preserving its identity. |
| 6 | Do not modify the input | Keep the supplied data intact while producing the requested result. |
| 7 | Use the provided method | Call the specified helper with the required arguments and use its result appropriately. |
| 8 | Method signature | In these examples, identify the Java method name and ordered parameter types. |
| 9 | Method header | Read the declaration before the body, including modifiers, return type and parameters where present. |
| 10 | Method body | Read or write the statements executed on a call. |
| 11 | Parameter | Name a variable declared to receive an argument when a method is invoked. |
| 12 | Argument | Identify the expression supplied at the call site. |
| 13 | Return type | Identify the type the method promises to return. |
| 14 | Void | Indicates that a method returns no value. |
| 15 | Call site | Locate the expression or statement where a method is invoked. |
| 16 | Instance method | A method invoked on an object that can access its instance state. |
| 17 | Static method | A class-level method that can be called without a receiver instance. |
| 18 | Class | A definition that specifies members for a type of object. |
| 19 | Object | A runtime instance of a class, or an array in Java. |
| 20 | Class header | Give the declaration that names the class and any required modifiers. |
| 21 | Constructor | Write the initialisation code run when a new instance is created. |
| 22 | Constructor header | Use the class name and required parameter list without declaring a return type. |
| 23 | Instance variable | Store data separately in each object. |
| 24 | Class variable | A static field shared across instances of the class. |
| 25 | Local variable | A variable declared within a method, constructor or block. |
| 26 | Scope | The region where a name can be used. |
| 27 | Field | A variable declared as a member of a class. |
| 28 | Initialise | Give a variable or object its starting state. |
| 29 | Instantiate | Create a new instance, typically with new. |
| 30 | Reference | A value used to refer to an object or array. |
| 31 | Alias | A second reference to the same object. |
| 32 | Null | A reference value that refers to no object. |
| 33 | Primitive type | A built-in value type such as int, double or boolean. |
| 34 | Reference type | A type whose values can refer to an object or array or be null. |
| 35 | Assign | Evaluate the right side and store the result in the target variable or location. |
| 36 | Declaration | Introduce a name with a type or other required declaration information. |
| 37 | Expression | A piece of code that evaluates to a value. |
| 38 | Statement | A complete instruction or control structure in Java source. |
| 39 | Cast | Explicitly request conversion to the target type where Java permits it. |
| 40 | Integer division | Divide integer operands and truncate the result toward zero. |
| 41 | Remainder operator | Use % to get the remainder after division. |
| 42 | Increment | Increase a value by one. |
| 43 | Decrement | Decrease a value by one. |
| 44 | Compound assignment | Apply an operation and store its result in the same target, such as with +=. |
| 45 | Operator precedence | Determine which operator binds first when grouping is implicit. |
| 46 | Boolean expression | Evaluate the condition to true or false. |
| 47 | Comparison operator | Test a relation such as less than or equality. |
| 48 | Logical AND | Evaluate true only when both conditions are true. |
| 49 | Logical OR | Evaluate true when either or both conditions are true. |
| 50 | Logical NOT | Reverse a Boolean value. |
| 51 | Short-circuit evaluation | Skip evaluating a right operand when the left operand already determines the Boolean result. |
| 52 | Branch | Select a code path based on a condition. |
| 53 | Nested conditional | A conditional statement inside another conditional’s branch. |
| 54 | Loop guard | The condition tested to decide whether a loop continues. |
| 55 | Loop update | The change made to control state between iterations. |
| 56 | Iteration | One repetition of a loop body. |
| 57 | Nested loop | A loop inside the body of another loop. |
| 58 | Traversal | Visit the required elements in the order the task specifies. |
| 59 | Enhanced for loop | Use Java’s for-each syntax to read elements one at a time when an index is unnecessary. |
| 60 | Accumulator | A variable updated to build a running result. |
| 61 | Counter | A variable that tracks how often an event occurs. |
| 62 | Sentinel value | A designated value used to signal a boundary or stopping condition. |
| 63 | Off-by-one error | An index or count mistake caused by moving a boundary one position. |
| 64 | Index | A zero-based position in a Java array, String or ArrayList. |
| 65 | Bounds check | Confirm an index is at least zero and smaller than the structure’s length or size. |
| 66 | Array | A fixed-length indexed collection of elements with a common declared type. |
| 67 | Array length | Read the number of array slots using length without parentheses. |
| 68 | Array initializer | Give an array its starting element values in the specified order. |
| 69 | ArrayList | A resizable indexed list that stores reference-type elements. |
| 70 | Generic type argument | The type supplied to a generic class, as String in ArrayList<String>. |
| 71 | Wrapper class | An object type corresponding to a primitive, such as Integer for int. |
| 72 | Size | Use size() to obtain the current number of elements in an ArrayList. |
| 73 | Get | Use get(index) to read the existing element at an ArrayList position. |
| 74 | Set | Use set(index, value) to replace an existing element without changing list size. |
| 75 | Add | Append an element or insert it at a valid position, depending on the overload. |
| 76 | Remove | Delete an element using the overload requested and account for later indices shifting. |
| 77 | Two-dimensional array | An array whose elements are arrays. |
| 78 | Row index | The first index in the usual grid interpretation of a Java 2D array. |
| 79 | Column index | The second index within a specified row. |
| 80 | Row-major traversal | Visit all relevant columns of each row before advancing to the next row. |
| 81 | Column-major traversal | Visit the relevant rows of each column before advancing to the next column. |
| 82 | Rectangular array | A 2D array whose rows have the same length. |
| 83 | String | An immutable Java sequence of characters used for text. |
| 84 | Substring | Use start inclusive and end exclusive indices when both are given. |
| 85 | String concatenation | Join text using + and check the grouping when numbers are present. |
| 86 | String equality | Use equals when the task compares String contents. |
| 87 | Reference equality | Use == to test whether two references refer to the same object or are both null. |
| 88 | Lexicographic order | Compare text using the ordering defined by the applicable comparison method. |
| 89 | Index of | Use indexOf to find the first matching occurrence, or recognise −1 for no match. |
| 90 | Encapsulation | Group state and behaviour and control direct access to internal details. |
| 91 | Public member | A member accessible to other code subject to visibility of its enclosing type. |
| 92 | Private member | A member intended for use within its defining class. |
| 93 | Accessor | A method that reports an aspect of object state. |
| 94 | Mutator | A method that changes object state. |
| 95 | This reference | Use this to refer to the current object in instance code. |
| 96 | Object state | The current values of an object’s fields. |
| 97 | Side effect | An observable change, such as updating a field or printing, beyond returning a value. |
| 98 | Precondition | A requirement callers may be expected to satisfy before the operation. |
| 99 | Postcondition | A result or state change the operation must guarantee afterward. |
| 100 | Edge case | An input at or near a boundary that may behave differently. |
| 101 | Test case | A specific input and expected result used to check the specification. |
| 102 | Dry run | Walk through the code by hand with concrete inputs. |
| 103 | Compilation error | A violation detected before normal execution, such as incompatible types. |
| 104 | Runtime exception | An exceptional condition occurring during execution. |
| 105 | Logic error | Code runs but yields an incorrect result for the intended task. |
| 106 | Linear search | Check elements in order until the desired result is found or the search ends. |
| 107 | Binary search | Narrow the range repeatedly in data sorted by the relevant ordering. |
| 108 | Selection sort | Repeatedly choose an extremal item from the unsorted region and put it in position. |
| 109 | Insertion sort | Build a sorted region by inserting each next item into its proper position. |
| 110 | Recursion | Solve a problem through method calls on smaller or simpler cases. |
| 111 | Base case | A case solved without another recursive call. |
| 112 | Recursive case | A case whose result depends on a recursive call and progress toward termination. |
Java task constraints and edge cases
| No. | Instruction or term | Meaning or action |
|---|---|---|
| 113 | Write a class | Provide the declaration, fields, constructor and methods specified. |
| 114 | Complete a method | Fill the method body while preserving its supplied header. |
| 115 | Method call | Invoke a method with an appropriate receiver and arguments. |
| 116 | Instance creation expression | Use new and the matching constructor arguments to create an object. |
| 117 | Overloaded method | A method sharing a name with another but having a different parameter list. |
| 118 | Zero-based indexing | Count the first position as zero. |
| 119 | Exclusive upper bound | Stop before the named upper index or limit. |
| 120 | Inclusive lower bound | Include the lower index or limit if it meets the other conditions. |
| 121 | Visit once | Process every required element exactly one time. |
| 122 | Preserve order | Keep the relative sequence of items that remain or are returned. |
| 123 | Empty list | A list with size zero. |
| 124 | Empty string | A String whose length is zero. |
| 125 | First match | The earliest eligible element in the required traversal order. |
| 126 | Last match | The final eligible element in the required traversal order. |
| 127 | Duplicate | An additional occurrence of a value already present under the stated equality rule. |
| 128 | Consecutive | Adjacent in the order being examined. |
| 129 | Neighbour | A nearby element whose position satisfies the rule in the prompt. |
| 130 | Row total | Add the eligible values across one row. |
| 131 | Column total | Add the eligible values down one column. |
| 132 | Diagonal entry | Use positions satisfying the relevant diagonal’s index rule. |
| 133 | Minimum | The smallest eligible value under the specified comparison. |
| 134 | Maximum | The largest eligible value under the specified comparison. |
| 135 | Tie | A case where competing values have the same ranking. |
| 136 | Stable order | Keep the prior relative order of equal-ranking elements when the task requires it. |
| 137 | Integer overflow | A fixed-width integer operation produces a value outside its representable range and can wrap. |
| 138 | Boolean flag | A variable that stores whether a condition has been met. |
| 139 | Loop invariant | A property that stays true at a designated point in each iteration. |
| 140 | Exit condition | The condition under which repetition stops. |
| 141 | Return early | Finish the method as soon as the required result is known and doing so preserves the contract. |
| 142 | Combine conditions | Use the appropriate Boolean operations and grouping to express the full requirement. |
| 143 | Sample output | The exact result shown for an example input. |
| 144 | Test the smallest allowed case | Use the minimum input size permitted by the specification. |
| 145 | System.out.print | Print a value without adding a line separator. |
| 146 | System.out.println | Print a value and then add a line separator. |
| 147 | Autoboxing | Java automatically converts a primitive value to its corresponding wrapper object where allowed. |
| 148 | Unboxing | Java extracts a primitive value from its corresponding wrapper where allowed. |
| 149 | Random value | A value generated within the range specified by the operation. |
| 150 | Java Quick Reference | Use the supplied reference to confirm listed library methods, parameter order and return types. |
| 151 | Boolean value | A value that is either true or false. |
| 152 | Index shift | Recalculate which position an element occupies after an insertion or removal. |
| 153 | Temporary variable | Store an intermediate value for use in a later expression or operation. |
| 154 | Swap | Exchange two values without losing either original value. |
| 155 | Pass by value | A method receives a copy of an argument value, including a copied reference for an object argument. |
| 156 | Input guarantee | A property the prompt promises, such as all array entries being non-null. |
Command words, logic and exam directions
| No. | Instruction or term | Meaning or action |
|---|---|---|
| 157 | Identify | Name the requested item or feature directly. |
| 158 | State | Give the requested fact or result in a concise form. |
| 159 | Describe | Report the relevant features, sequence or pattern. |
| 160 | Explain | Connect the result to a cause, mechanism or principle. |
| 161 | Compare | Use the same basis for both cases and state the relevant relationship. |
| 162 | Contrast | State a difference between the named cases on a common basis. |
| 163 | Determine | Use the information given to reach the requested result. |
| 164 | Predict | State the outcome expected under the supplied conditions. |
| 165 | Justify | Connect specific evidence or a rule to the answer you give. |
| 166 | Calculate | Use the supplied values and the relevant relationship to produce a result. |
| 167 | Estimate | Give a reasonable approximate value from the information provided. |
| 168 | Interpret | Explain what the result means in the scenario. |
| 169 | Analyze | Break the information into relevant parts and explain how they relate. |
| 170 | Evaluate | Judge the claim, design or result against a stated or relevant criterion. |
| 171 | Support | Give evidence that strengthens the named claim. |
| 172 | Select | Choose the option that meets the stated condition. |
| 173 | Define | State the meaning of the term with its essential features. |
| 174 | Give one | Supply one relevant answer that meets the task. |
| 175 | Indicate | Point to or state the feature the prompt asks for. |
| 176 | Complete | Fill the missing parts while preserving the given structure. |
| 177 | Construct | Produce the specified representation using the information given. |
| 178 | Outline | Give the main steps or features in a logical order. |
| 179 | Infer | Draw a conclusion supported by the clues or evidence supplied. |
| 180 | Suggest | Offer a plausible answer that fits the scenario and constraints. |
| 181 | Distinguish | Name the feature that separates two easily confused ideas. |
| 182 | Demonstrate | Show that a stated claim follows by giving appropriate steps or an example. |
| 183 | Check | Test the proposed result against the original conditions. |
| 184 | Represent | Express the same information in the requested form. |
| 185 | Evidence | A relevant observation, value, result or example that supports a claim. |
| 186 | Claim | A statement that can be tested or supported. |
| 187 | Assumption | A condition treated as true for the purpose of the reasoning. |
| 188 | Constraint | A restriction the answer must satisfy. |
| 189 | Criterion | The rule or standard used to judge whether a choice works. |
| 190 | Condition | A requirement or circumstance that affects the conclusion. |
| 191 | Conclusion | The result of the reasoning stated in the question’s context. |
| 192 | Exception | A case that departs from the stated rule. |
| 193 | Counterexample | A case that disproves a general claim. |
| 194 | Magnitude | The size of a quantity, considered separately from direction. |
| 195 | Direction of change | State whether the quantity increases, decreases or stays unchanged. |
| 196 | Initial value | The value at the stated starting point. |
| 197 | Final value | The value at the stated end point. |
| 198 | Signed change | Subtract the initial value from the final value and retain the sign. |
| 199 | Relative change | Divide the difference by the initial value when that baseline is meaningful. |
| 200 | Sequence | Give the steps or outputs in their required order. |
What the AP Computer Science A exam requires
College Board lists the regular 2027 exam for 12 May 2027. Fully digital. Complete both sections in Bluebook. The Java Quick Reference is available in the app.
| Section | Format and weight |
|---|---|
| I · Multiple choice | 42 questions in 90 minutes, worth 55%. Most are standalone, with occasional short sets. |
| II · Free response | 4 questions in 90 minutes, worth 45%. Prepare for methods and control structures, class design, ArrayList data tasks and 2D array tasks. |
| Calculator policy | College Board prohibits calculators for this course except for students with an approved four-function calculator accommodation. |
AP is a U.S.-based subject examination programme taken by students in the United States and internationally. Practise with the College Board materials for the exact course. If you are taking the exam outside the U.S., confirm registration and local reporting time with your school or test centre. The same vocabulary strategy transfers to other national exams by matching the verb, scope and answer format to that exam’s own sample paper and scoring guidance.
Write down the requested signature and work through a small example before typing the body. Track return values and changes to objects separately. Check the first and last legal indices and any input size allowed by the prompt.
Read the method contract before typing
Copy the required method name and parameter list into your working plan. Identify what the method returns and whether the supplied object changes. If the method is meant to update an instance field, make that update before returning any new value the contract requires.
Use a tiny trace to check loop boundaries
Choose an example with two or three elements and label the indices. After each loop step, write the index and relevant variable values. If elements are removed during traversal, redraw the list after each deletion. This shows which original values are still waiting to be checked.
Test the cases the prompt allows
If an empty list is allowed, use it as a test. If every row is guaranteed to have at least one entry, focus on boundaries within that guarantee. The Java Quick Reference can confirm available methods, but the prompt tells you which inputs to support and whether the operation must preserve order or identity.
Worked examples for common exam instructions
Implement a method that returns a count
Prompt. Write a method that returns the number of strings in a non-null ArrayList of non-null strings that start with A. Leave the list unchanged.
Answer. Start an integer counter at zero. For each string s, test s.length() > 0 && s.substring(0, 1).equals(“A”). Increment the counter on a match and return the counter after the loop.
public int countStartingWithA(ArrayList<String> values) {
int count = 0;
for (String s : values) {
if (s.length() > 0 && s.substring(0, 1).equals("A")) {
count++;
}
}
return count;
}
The length test protects the substring call because && short-circuits. No list elements are added, removed or replaced.
Design a class with a persistent field
Prompt. A Counter object starts at a supplied integer and exposes an add method that increases its stored value by the amount supplied and returns the updated value.
Answer. Declare a private int field named value. The constructor Counter(int start) assigns value = start. The method public int add(int amount) updates value += amount and returns value.
public class Counter {
private int value;
public Counter(int start) {
value = start;
}
public int add(int amount) {
value += amount;
return value;
}
}
An instance field persists across calls and each object has its own value. A local variable declared inside add would not maintain the required state.
Modify an ArrayList while preserving order
Prompt. Remove every negative Integer from a non-null ArrayList of non-null values. Preserve the order of the values left in the same list.
Answer. Visit indices from values.size() − 1 down to zero. At each index i, if values.get(i) < 0, call values.remove(i).
public void removeNegatives(ArrayList<Integer> values) {
for (int i = values.size() - 1; i >= 0; i--) {
if (values.get(i) < 0) {
values.remove(i);
}
}
}
On removal, positions to the right shift left, but the next position to visit is to the left. Backward traversal also handles consecutive negative entries.
Translate a 2D array specification
Prompt. Return the number of positive entries in a non-null rectangular int grid. An empty grid is allowed.
Answer. Start count at zero. For each row r from zero to grid.length − 1, check columns c from zero to grid[r].length − 1. Increment count when grid[r][c] > 0. Return count after both loops.
public int countPositive(int[][] grid) {
int count = 0;
for (int r = 0; r < grid.length; r++) {
for (int c = 0; c < grid[r].length; c++) {
if (grid[r][c] > 0) {
count++;
}
}
}
return count;
}
Using grid[r].length inside the outer loop means an empty grid never causes a read of grid[0]. The return after both loops lets the method finish counting every row.
Use the Fencing Method to build an answer
Start within a small boundary. Answer one instruction correctly in a short sentence or a small piece of code. Add one detail at a time, checking that each addition helps satisfy the prompt. Finish by transferring the same skill to a nearby case.
Start. Return the number of matches.
Add context. Visit each element once, count matches and return after the loop.
Add the reasoning or operation. Start count at zero, test each string for a nonempty prefix before taking its substring, increment only for a match and return after the traversal.
Transfer. Change the prompt to remove matches from the input list. Use a trace with two adjacent matches to check whether your index strategy meets the new contract.
Practice with the 200 terms
Choose three terms with different answer shapes. Cover the meaning column and say what an examiner would expect to see. Write one answer to each, then underline the exact number, evidence, explanation or code that fulfils the instruction.
Trace versus implement
Try it. Trace the backward-removal method on [−2, −1, 4, −3], then write one test case that checks that a list with no negative numbers is unchanged.
Check. The successive deletions produce [−2, −1, 4], [−2, 4], and then [4]. For the additional test, use [0, 2] and expect the same list with contents [0, 2].
On a second pass, test the examples in the question and one boundary case allowed by the specification. Practise typing an entire free response in a plain editor, then compare it with the published scoring guidelines for a released question.
Frequently asked questions
Does a code-writing task need a prose explanation?
When the prompt asks you to implement, give the Java code it requests. Use a short private trace to verify the result and preserve any given header or class details.
Do I have to memorise every definition?
Use the terms in small groups. For each one, practise identifying the required answer and producing it. The exact instructions and official scoring guidelines for an individual item determine what that response needs.
Official sources and next reading
College Board AP Computer Science A exam format, course description and released questions · College Board AP calculator policy
AP exam command words · eduKateSG vocabulary learning guide · How to build a sentence with the Fencing Method