J
AP Java Practice Lab
Starter-friendly coding playground
Designed for AP Computer Science A
Practice Problems 3 problems
Tip: Work through each problem without looking at the solution. Use the tests to check your logic, not just your output.
Code Editor Java 17 (AP style)
Select a problem

Welcome 👋

Choose a problem on the left. You’ll see the prompt, starter code, and example tests.

Write your solution in the editor below, then click Run Code to send it to your Java runner.

Teacher note: This page expects a POST endpoint at /api/java/run. Wire it up to your favorite sandbox or judge.

Main.java
Java
1
Use Tab to indent. Focus on readable code: good names, clear logic, and correct edge cases.
Output & Tests Feedback zone
Idle. Write some code ✨
Console no runs yet
// Output from your program will appear here.
Sample tests
Select a problem to see the AP-style test cases.