In AP Computer Science A, createList is a method (from the 2024 FRQ's WordChecker class) that traverses an ArrayList<String>, selects the words that begin with a target string, removes that prefix from each, and returns the results in a new ArrayList.
createList is a classic "original algorithm" in the AP CSA sense. It isn't a built-in Java method. It's a method you write that walks through an ArrayList of strings, checks each one against a condition (does it start with a given target string?), and for every match, chops off that prefix and adds what's left to a brand-new list. So if the list contains "unhappy", "under", and "happy" and the target is "un", createList returns a list containing "happy" and "der".
Think of it as two standard moves stitched together. First, a filtering traversal (keep only elements with a property). Second, a String transformation on each survivor (substring off the prefix). That combo is exactly what EK 4.10.A.2 is talking about when it says some ArrayList algorithms require String methods inside the loop. The big design point is that createList builds and returns a new ArrayList instead of mutating the original, which sidesteps the classic remove-while-traversing trap.
createList lives in Topic 4.10 (Developing Algorithms Using ArrayLists) in Unit 4: Data Collections. It directly supports learning objective 4.10.A, which asks you to develop code for standard and original algorithms involving ArrayList objects and to determine what those algorithms produce. EK 4.10.A.1 lists the standard traversal patterns (count elements with a property, insert, delete, and so on), and createList is what happens when the exam remixes those patterns into something original. It also hits EK 4.10.A.2, since you need String methods working alongside the loop. If you can write createList cold, you've proven you can handle the ArrayList FRQ, which shows up on the free-response section essentially every year.
Keep studying AP® Computer Science A Unit 4
Traversal (Unit 4)
createList is a traversal at its core. You visit every element exactly once with a for or enhanced for loop. The twist is that you're reading from one list and writing to another, so you never have to worry about skipping elements the way you do when you remove from a list mid-loop.
Standard ArrayList algorithms (Unit 4)
EK 4.10.A.1 lists patterns like "determine the number of elements having a particular property" and "insert elements." createList is those two patterns fused together. Once you see original algorithms as remixes of standard ones, FRQ prompts stop feeling brand new.
String methods (Unit 1)
The prefix check and prefix removal run on String tools like substring, length, and equals from way back in Unit 1. EK 4.10.A.2 makes this explicit. ArrayList algorithms often need String manipulation inside the loop, so Unit 1 skills never actually go away.
Duplicate elements (Unit 4)
Both createList and duplicate-detection are property-based traversals over a list. The difference is the question each loop answers. Duplicate checks compare elements to each other, while createList compares each element to an outside target string.
createList comes straight from the 2024 FRQ Q3, which gave you a WordChecker class holding an ArrayList
createList does not delete anything from the original list. It leaves the original untouched and builds a separate result list. The "delete elements" standard algorithm in EK 4.10.A.1 mutates the list in place, which forces you to manage shifting indices (the classic bug where removing at index i skips the next element). Filtering into a new list avoids that problem entirely, which is exactly why FRQ specs like createList ask you to return a new ArrayList.
createList is the method from the 2024 AP CSA FRQ Q3 (WordChecker) that returns a new ArrayList of strings that start with a target prefix, with that prefix removed from each.
It supports LO 4.10.A, which requires you to both write original ArrayList algorithms and predict their output.
The algorithm is a filtering traversal plus a String transformation, combining EK 4.10.A.1 patterns with the String methods called out in EK 4.10.A.2.
Build a new list instead of removing from the original, because removing while traversing causes index-shifting bugs that cost FRQ points.
When stripping a prefix of length n, the leftover text is str.substring(n), and getting that index right is where most substring mistakes happen.
Don't forget the bookends of the method, declaring the new ArrayList before the loop and returning it after.
createList is a method from the 2024 AP CSA FRQ Q3 (the WordChecker class) that traverses an ArrayList
No. createList leaves the original list completely intact and returns a brand-new ArrayList holding the transformed matches. That design choice is what lets you avoid the remove-while-traversing bug.
The delete-elements algorithm from EK 4.10.A.1 mutates the list in place with remove, so you have to adjust your index after each removal. createList never calls remove. It copies transformed matches into a new list, so indices never shift and the original data survives.
Yes. It appeared on the 2024 FRQ Q3, where the WordChecker class contained an ArrayList
You mainly need substring to check the prefix and strip it, length to know how many characters to cut, and equals to compare strings (never == for String content). EK 4.10.A.2 explicitly flags that some ArrayList algorithms require String methods like these inside the traversal.
Connect this key term to the AP exam workflow: review the course, practice questions, and check related study tools.
Review units, study guides, and course resources.
Check this vocabulary in multiple-choice context.
Apply key concepts in written AP responses.
Estimate the exam score you are working toward.
Review the highest-yield facts before practice.
Put the full course together before test day.