Learnr

Learn AP Computer Science

Write real Java and understand how computing shapes the world.

or browse all courses.

Free to start. Built from a single prompt. No credit card.

There are two AP computer science courses. AP Computer Science A is a programming course taught in Java, covering variables, conditionals, loops, classes, arrays, lists and algorithms, with free-response questions where you write code. AP Computer Science Principles is broader, covering data, the internet, algorithms, programming in a language your class chooses, and the social impact of computing, and it includes a programming project. Learnr has no tie to the College Board; it builds a course for whichever one you are taking.

How to learn AP Computer Science, step by step

  1. Confirm which course you are taking. CSA is a Java programming course, while CSP covers broader computing concepts plus a project. They have different exams and skills, so check the current course description on the College Board site before choosing study materials.
  2. Write code every day, not just read it. Type out small programs: summing an array, finding a maximum, reversing a string, counting matches in a list. Run them, break them on purpose, and fix the errors, because debugging builds the intuition that reading alone never does.
  3. Practice tracing code on paper. Many multiple-choice questions show a loop or method and ask what it prints. Make a table of each variable as the code runs, line by line, and watch for off-by-one errors and integer division.
  4. Learn the standard algorithms cold. For CSA, be able to write linear search, traversals of arrays and two-dimensional arrays, and insertion or removal in an ArrayList without skipping elements. Short Learnr lessons can quiz these patterns daily until they become reflexes.
  5. Practice free-response questions with a timer. Use released CSA free-response questions and write complete methods within the time you would have. Check your answers against the official scoring guidelines, which reward correct logic even with small syntax slips.
  6. Plan the CSP project early. If you take Principles, follow your teacher's timeline and the official guidelines for the programming project. Choose a small idea that uses a list and a procedure with a parameter, and document your own code clearly.

What you'll learn

  • Write Java methods using loops, conditionals and arrays or array lists
  • Design simple classes with fields, constructors and methods
  • Trace code by hand and predict its output
  • Explain how data is represented and how the internet moves it
  • Build and document a small program for the CSP project

What's inside your AP Computer Science course

A sample path Learnr builds for AP Computer Science. Your real course adapts to your goal and level.

  • 1. Which AP CS course is right for you
  • 2. Variables, expressions and control flow
  • 3. Methods, classes and objects
  • 4. Arrays, lists and two-dimensional data
  • 5. Algorithms: searching, sorting and recursion basics
  • 6. Data, the internet and the impact of computing

How long does it take to learn AP Computer Science?

Complete beginners usually need a full school year for CSA, with code practice several times a week. CSP is gentler and suits a semester to a year. Students with prior programming experience can self-prepare in 2 to 4 months.

What you need before you start

For CSA, comfort with Algebra 1 and logical thinking; no prior coding is required, though any exposure helps. CSP assumes no programming background at all.

Common mistakes to avoid

  • Watching tutorials without writing code. Programming is a skill you build by typing, running and debugging your own small programs.
  • Removing items from an ArrayList while looping forward and skipping elements. Loop backward or adjust the index when you remove.
  • Confusing == with .equals() for String comparisons in Java. Use .equals() to compare string contents.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn AP Computer Science, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full AP Computer Science course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

AP Computer Science questions, answered

Should I take AP CSA or AP CSP?

CSP suits students new to computing who want a broad survey. CSA suits students ready for serious programming in Java and is closer to a first college programming course. Many students take CSP first.

What language does AP Computer Science A use?

AP CSA uses Java. AP CSP lets schools choose a language, often a block-based one or Python or JavaScript, and its exam uses a language-neutral pseudocode.

Explore more courses

More test prep courses

See all test prep courses

Ready to learn AP Computer Science?

Start your free, personalized AP Computer Science course in seconds. .