All practice worksheets

AP Computer Science practice worksheet

Read the full AP Computer Science worksheet online or take it as timed practice. Sign in to submit your answers for analysis.

Open worksheet PDF

Question 1

In Java, an object is created with the keyword:

  1. void
  2. static
  3. new
  4. class

Question 2

Which loop runs at least zero times and checks its condition first?

  1. while
  2. do-while only
  3. None
  4. goto

Question 3

A constructor in Java:

  1. Must be static
  2. Initialises a new object
  3. Returns a value always
  4. Deletes objects

Question 4

The index of the first element in a Java array is:

  1. Depends
  2. 1
  3. 0
  4. −1

Question 5

What is the result of 7 / 2 in Java when both are ints?

Question 6

Explain the difference between a primitive type and a reference type in Java.

First page of the InfinitySheets AP Computer Science practice worksheet
First page of the InfinitySheets AP Computer Science practice worksheet

Enable JavaScript to take the interactive worksheet or submit your work for analysis.