The AP(*) Subset - EXPLAINED!

   The Collegeboard provides a subset of the topics that are covered in the AP Computer Science Exam, both for the A and AB exams. We here at the JJ Dream Team looked at this subset, and realized that, though it listed all the topics, it was neither very descriptive nor particularly readable. We then endeavored to rewrite the subset, giving examples, and explaining each of the terms in more simple form. The following list is the result - this page is the subset for the A exam.


  1. Primitive Types: Primitive types on subset and not on subset, String functions and concatenation
  2. Arithmetic Operators: +, -, *, /, %
  3. Increment and Decrement Operators: ++ and -- are part of the subset but will not be used in other expressions.
  4. Assignment Operators: = , +=, -=, *=, /=, %=
  5. Relational operators: ==, !=, <, <=, >, >=
  6. Logical operators: &&, ||, !, and Short-circuit evaluation
  7. Ternary operator: The Ternary operator is not on the Subset
  8. Primitive data manipulation:Numeric Casts, truncation, and rounding
  9. String concatenation: Using '+' operator; number conversion to String, .toString() invocation on objects
  10. Escape sequences: \\ , \* , \n
  11. User input: Using IO.readInt()
  12. User Output: Using System.out.print() and the System.out.println()
  13. The main method: Main methods are not on the Subset, but program invocation with a simple main method may occur
  14. Arrays: one- (and two-dimensional arrays, which are only on the "AB" exam ... although when we wrote this, two-dimensional arrays were on the list for the "A" exam), arrays of primitive types and objects, initialization of named arrays
  15. Control structures: if, if/else, while, for, return
  16. Method overloading: Multiple functions with the same name but different signatures
  17. Classes: Using the new operator to construct a new object, and passing a constructor parameters
  18. Visibility: Public and Private
  19. Comments: Using comments to give information in the code
  20. The final keyword: Denoting that a field's value cannot be changed
  21. Static Methods: Utility functions that are helpful to have with a class.
  22. Static Final Variables: Only static final variables are in subset: other static variables are not tested
  23. NULL: The value of nothing
  24. this: Referencing the entirety of a class
  25. Super: Invoking a superclass constructor
  26. Initialization: Creating constructors that initialize all instance variables
  27. Subclasses: Overriding, Polymorphism, Extending, and Implementing
  28. Interfaces and Abstract classes: Class manipulation
  29. Object equality and identity: Checking content and identity
  30. Cloning: Cloning is not in the subset
  31. Finalize: The finalize method is not in the subset
  32. Casting (objects): Changing a class from a larger scope to a smaller scope
  33. Packages and Import: Organizing projects
  34. Inner classes: Not in the subset
  35. Threads: Not in the subset
  36. Exceptions: Understanding exceptions


    Java Reserved Words

    Notice that this list of reserved words is not the same as the list of Java keywords. The below list of reserved words include the values false, true, and null,
    as well as words reserved for possible future releases of Java goto, and const.

    Java 1.4.2 Reserved Word List
    Words in gray are not part of the AP Java subset, and thus will not appear on the exam.

    • abstract
    • assert (new in Java 2)
    • boolean
    • break
    • byte
    • case
    • catch
    • char
    • class
    • const (not used, but reserved)
    • continue
    • default
    • do
    • double
    • else
    • extends
    • false (a value, not a keyword)
    • final
    • finally
    • float
    • for
    • goto (not used, but reserved)
    • if
    • implements
    • import
    • instanceof
    • int
    • interface
    • long
    • native
    • new
    • null (a value, not a keyword)
    • package
    • private
    • protected
    • return
    • public
    • short
    • static
    • strictfp (new in Java 2)
    • super
    • switch
    • synchronized
    • this
    • throw
    • throws
    • transient
    • true (a value, not a keyword)
    • try
    • void
    • volatile
    • while


    Java Operator Precedence

    The below operators are listed with the higher precedence on top. A higher precedence means that it is evaluated before other operators in the same expression. Operators in the same grouping (below) have equal precedence, which means they are evaluated left to right.

    Example of higher precedence (multiplication(*) before addition(+)):

    System.out.print("4 + 3 * 2 = ");
    System.out.println(4 + 3 * 2); // (3 * 2) happens first
    
    Example of equal precedence (left to right):
    System.out.print("7 - 6 + 5 = ");
    System.out.println(7 - 6 + 5); // (7 - 6) happens first, not that it matters :)
    
    Java 1.4.2 Operator Precedence Table (based on a page of the Java Tutorial)
    Operators in gray are not part of the AP Java subset, and thus will not appear on the exam.

    Note that
    expr means an expression
    lhs means a left-hand-side (of an assignment), such as aVariable, or anArray[i]

    • postfix operators (this has the highest precedence and will happen first)

      • []
        array subscript

      • .
        access entity of an object (or a static entity of a class)

      • (expr)
        parenthesis around an expression

      • lhs++
        increment an entity by one in a for-loop command or in its own command (or anywhere an expression is allowed)

      • lhs--
        decrement an entity by one in a for-loop command or in its own command (or anywhere an expression is allowed)

    • unary operators

      • ++lhs

      • --lhs

      • +expr
        unary plus

      • -expr
        unary minus

      • ~

      • !
        unary not

    • creation or cast

      • new
        create a new object (calls a constructor)

      • (type)expr
        cast the expr to an int or a double (or any particular type)

    • multiplicative

      • *
        multiplication

      • /
        division

      • %
        modulo

    • additive

      • +
        addition

      • -
        subtraction

    • shift

      • <<

      • >>

      • >>>

    • relational

      • <
        less than

      • >
        greater than

      • <=
        less than or equal to

      • >=
        greater than or equal to

      • instanceof

    • equality

      • ==
        is equal to

      • !=
        is not equal to

    • bitwise AND
      • &

    • bitwise exclusive OR
      • ^

    • bitwise inclusive OR
      • |

    • logical AND
      • &&

    • logical OR
      • ||

    • conditional
      • ? :

    • assignment (this has the lowest precedence and will happen last)

      • =
        as part of an assignment command (or as part of an expression)

      • += (same restrictions as above)

      • -= (same restrictions as above)

      • *= (same restrictions as above)

      • /= (same restrictions as above)

      • %= (same restrictions as above)

      • &=

      • ^=

      • |=

      • <<=

      • >>=

      • >>>=


    (*) AP is a registered trademark of the College Entrance Examination Board, which as not involved in the production of, and does not endorse, this material