Aa

Text size

?

Guide

What is JavaPlay?

A place to learn the Java syntax used in AP Computer Science A, step by step. Code runs right in your browser, and errors read like real javac messages. Nothing is locked: start anywhere.

Activity types

🔮 Predict
Read the program and choose what it prints. Then run it to check.
👣 Trace
Step through one line at a time and watch the variables change, then answer questions.
🧩 Order
Put the lines in order. One extra line is a trap.
✏️ Fill in
Type the missing pieces so the program prints the target.
🔧 Modify
Change a working program to do something new.
🐞 Debug
Read the compile error or exception, find the line, and fix it.
⌨️ Write
Write the code yourself. Method tests show which cases pass.

Hints and answers

Hints open one at a time. When you are stuck you can see the answer at any time, and you can still finish the activity.

Java not supported yet

switch, try/catch, long, interfaces and lambdas are reported as "not supported yet". That does not mean your code is wrong.

Scanner can read the virtual files shown in an activity and strings. Numbers use US formatting (decimal point and comma grouping).

To the map