AP Computer Science A · College Board müfredatı (2025–26 CED)

AP Computer Science A

Java ile programlama: nesneler ve metotlar, koşullar ve döngüler, sınıf yazma, diziler ve ArrayList, özyineleme, arama ve sıralama.

4 ÜNİTE
2025–26 yeni CED
TAM DİJİTAL
MCQ ve kod yazımı Bluebook'ta
12 MAYIS
2027 sınav günü (öğleden sonra)
TAM DİJİTAL • BLUEBOOK

AP Computer Science A (Java)

Java dilinde nesne yönelimli programlama, sınıf tasarımı (Classes), String ve koleksiyon (ArrayList, 2D array) algoritmaları, özyineleme ve arama/sıralama. 2025-26 CED (College Board ders çerçevesi)'de kalıtım (Inheritance) kapsam dışıdır.

public class Student { private String name; ... }
Binary Search: O(log N) | Merge Sort: O(N log N)

Unit 1: Using Objects and Methods

Değişkenler, ifadeler, nesne oluşturma ve metot çağırma; String nesnesi ve metotları. Çoktan seçmeli bölümün kod izleme sorularının temeli.

1.15 & 2.10 String Methods and String Algorithms Topic 1.15

A String is an immutable object: every method returns a new value and never changes the original. Indices start at 0, and substring(a, b) includes index a but excludes index b, so its length is b − a. indexOf(str) returns the index of the first occurrence, or −1 if str is not found. compareTo returns a negative, zero, or positive int based on character codes, and every uppercase letter comes before every lowercase letter.

Comparing Strings: s1.equals(s2) compares the characters; s1 == s2 only asks whether both variables refer to the same object. A String built at run time (for example "A" + w.substring(1)) is a new object, so == can be false even when the text is identical.
AP TRAP — Discarded return values: w.substring(1); on its own line changes nothing. Only an assignment such as w = w.substring(1); updates the variable.

Unit 1 Using Objects and Methods: İnteraktif Soru İstasyonu

Özgün AP tarzı sorular (geçmiş sınav sorusu değil). Şık seç; anında çözüm ve hata türü gelir.

Unit 2 Selection and Iteration: İnteraktif Soru İstasyonu

Boolean ifadeler, if / else, while ve for döngüleri, iç içe döngüler ve String üzerinde algoritmalar.

Unit 3: Class Creation

Sınıf yazma: örnek değişkenleri, kurucular, erişim ve değiştirme metotları, kapsülleme, this, statik üyeler ve referanslar.

Scope note: In the 2025-26 CED, implementing inheritance relationships (extends, super, overriding, polymorphic references) is outside the scope of the AP CSA course and exam, so this page has no new inheritance questions. Kaynak: College Board, AP CSA Revisions ve AP CSA Course (13 Ekim 2026'da kontrol edildi).
3.3–3.9 & 1.13 Class Design: Constructors, Encapsulation, References and null Topic 1.13

A well-designed class keeps its instance variables private (encapsulation) and exposes behavior through public constructors, accessors, and mutators. A constructor has the class name and no return type; it initializes every instance variable. If a class defines any constructor, Java does not add a no-argument default constructor, so new Book() fails when only Book(String, int) exists. A void method returns nothing and cannot be used inside an expression such as println(...).

Java always passes by value: for a primitive, the method receives a copy of the number; for an object or array, it receives a copy of the reference. The method can therefore change the object's contents but never the caller's primitive variable. After Counter c2 = c1; both variables are aliases of one object.
AP TRAP — null: storing null and testing x == null are safe; calling a method on null (for example x.length()) throws a NullPointerException. The empty String "" is a real object with length 0.
Java Object-Oriented Architecture 2025-26 CED Unit 3 • OOP Architecture

The 4 Pillars of OOP in Java:
1. Encapsulation: Instance variables declared private, accessed solely through public accessor (getter) and mutator (setter) methods to protect internal object state.
2. Inheritance: A subclass inherits public and protected members of a superclass via the extends keyword. The subclass constructor must invoke super(...) as its very first statement. (Scope note: implementing inheritance is outside the 2025-26 AP CSA course and exam; it remains useful background for university Java courses.)
3. Polymorphism (also beyond the 2025-26 exam scope): An object reference of a superclass type can point to an instance of any subclass:
SuperClass obj = new SubClass(); $\implies$ Method execution is determined at runtime via dynamic method lookup.
4. Abstraction: Abstract classes and interfaces specifying method signatures without concrete implementation.

Array vs. ArrayList Memory Mechanics: Primitive arrays have a fixed size (arr.length). ArrayList<E> is dynamically resizable and stores only object references (using auto-boxing for primitives: Integer, Double). When removing elements from an ArrayList, always loop from back to front (for (int i = list.size() - 1; i >= 0; i--)) to prevent skipping adjacent elements!

Unit 3 Class Creation: İnteraktif Soru İstasyonu

Özgün AP tarzı sorular (geçmiş sınav sorusu değil). Şık seç; anında çözüm ve hata türü gelir.

Unit 4: Data Collections

Diziler, ArrayList, 2B diziler, özyineleme, arama ve sıralama: çoktan seçmeli bölümün en ağır ünitesi (%30–40).

4.8–4.10 ArrayList: Index Shifts While Adding and Removing Topic 4.8

add(obj) appends; add(i, obj) inserts at index i and shifts later elements right; remove(i) deletes and shifts later elements left; set(i, obj) replaces without shifting. Rewrite the whole list after every call: the second remove works on the already shifted list.

Safe traversal patterns: to remove while looping, traverse from the back (for (int i = list.size() - 1; i >= 0; i--)) or decrement i after each removal. After inserting at index i, increase i once more so the same element is not processed again. The condition i < list.size() is re-evaluated on every iteration.
AP TRAP — Enhanced for loops: adding to or removing from an ArrayList inside a for-each loop throws a ConcurrentModificationException. For arrays of primitives, assigning to the for-each variable changes only a copy.
4.11–4.13 2D Arrays: Dimensions and Traversal Order Topic 4.11

new int[rows][cols] creates an array of rows. grid.length is the number of rows and grid[0].length is the number of columns. Row-major traversal uses the row index in the outer loop; column-major traversal uses the column index in the outer loop. Default element values are 0, 0.0, false, or null.

Dependent bounds: when the inner loop starts at the outer index (for (int c = r; ...)), each row visits a different number of cells: this traces the upper triangle including the main diagonal. Sketch the grid and mark the visited cells before adding anything.
4.16–4.17 Recursion: Tracing the Call Stack Topic 4.16

Every recursive method needs a base case that returns without another call and a recursive step that moves toward it. Trace with one line per call, going down until the base case, then combine return values on the way back up. Statements written after the recursive call run during this unwinding, so output appears in reverse order.

Recursive binary search: each call computes mid = (lo + hi) / 2 and recurses on one half. When the target is absent, the search ends with a call where lo > hi, and that call counts too. Merge sort splits the array in half recursively and merges the sorted halves.
4.14–4.15 Searching and Sorting: Intermediate States Topic 4.14

Linear search checks elements in order and returns the first matching index (or −1); it works on unsorted data. Binary search requires sorted data and halves the range each step. Selection sort finds the minimum of the unsorted part and swaps it into position j, so after k passes the first k elements are final. Insertion sort shifts larger elements right and inserts the current element, so after k passes the first k + 1 elements are sorted among themselves.

AP TRAP: "after two passes" questions are designed so that selection sort, insertion sort, and a fully sorted array give different answers. Trace the exact algorithm in the code, one pass at a time.
Algorithmic Complexity & Recursion 2025-26 CED Unit 4 • Computational Thinking

Big-O Asymptotic Running Time:
• Sequential (Linear) Search: $O(N)$ best for unsorted arrays.
• Binary Search: $O(\log N)$ requires a pre-sorted array, halving search space at each iteration.
• Selection Sort & Insertion Sort: $O(N^2)$ worst and average case quadratic time.
• Merge Sort: $O(N \log N)$ recursive divide-and-conquer algorithm; consistent performance across all data distributions.

Recursive Tracing & The Call Stack: Every recursive method requires: (1) A Base Case that terminates without further recursive calls, and (2) A Recursive Step that moves closer to the base case. Omitting the base case causes a runtime StackOverflowError.

Unit 4 Data Collections: İnteraktif Soru İstasyonu

Özgün AP tarzı sorular (geçmiş sınav sorusu değil). Kodlu sorular çalıştırılarak doğrulandı.

Java FRQ Kod Yazım Kuralları

• NullPointerException ve ArrayIndexOutOfBounds hatalarına karşı döngü sınırlarını (i < arr.length) kontrol et.
• Sınıf içi private değişkenlere doğrudan değil, getter/setter metotlarıyla eriş.
• equals() vs == farkını String karşılaştırmasında asla unutma!