AP Computer Science Java Review
2025 Questions and Answers
What are the four valid commands Karel knows? - ANSWER✔✔--move();
-turnLeft();
-putBall();
-takeBall();
Which of these is a valid Java Karel command?
A.) move();
B.) move;
C.) move()
,D.) move(5) - ANSWER✔✔-A.) move();
What are rows known as in Karel's world? - ANSWER✔✔-Streets
What are the columns known as in Karel's world - ANSWER✔✔-Avenues
If Karel starts at Street 1 and Avenue 3 facing East, what row and column will Karel be
on after this code runs?
move();
move();
move();
turnLeft();
move(); - ANSWER✔✔-Street 2 and Avenue 6
How do you write a Java Class? - ANSWER✔✔-public class SquareKarel extends Karel
{
}
What is the Run Method? - ANSWER✔✔-The place where our program starts running
, public void run()
{
}
How do you write a Java Class with Run Method? - ANSWER✔✔-public class
SquareKarel extends Karel
{
public void run ()
{
// our code goes here
}
}
What is the run method in a Java program with Karel?
A.) A method that always makes Karel move in a square.
2025 Questions and Answers
What are the four valid commands Karel knows? - ANSWER✔✔--move();
-turnLeft();
-putBall();
-takeBall();
Which of these is a valid Java Karel command?
A.) move();
B.) move;
C.) move()
,D.) move(5) - ANSWER✔✔-A.) move();
What are rows known as in Karel's world? - ANSWER✔✔-Streets
What are the columns known as in Karel's world - ANSWER✔✔-Avenues
If Karel starts at Street 1 and Avenue 3 facing East, what row and column will Karel be
on after this code runs?
move();
move();
move();
turnLeft();
move(); - ANSWER✔✔-Street 2 and Avenue 6
How do you write a Java Class? - ANSWER✔✔-public class SquareKarel extends Karel
{
}
What is the Run Method? - ANSWER✔✔-The place where our program starts running
, public void run()
{
}
How do you write a Java Class with Run Method? - ANSWER✔✔-public class
SquareKarel extends Karel
{
public void run ()
{
// our code goes here
}
}
What is the run method in a Java program with Karel?
A.) A method that always makes Karel move in a square.