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.
- Primitive Types: Primitive types on subset and not on subset, String functions and concatenation
- Arithmetic Operators: +, -, *, /, %
- Increment and Decrement Operators: ++ and -- are part of the subset but will not be used in other expressions.
- Assignment Operators: = , +=, -=, *=, /=, %=
- Relational operators: ==, !=, <, <=, >, >=
- Logical operators: &&, ||, !, and Short-circuit evaluation
- Ternary operator: The Ternary operator is not on the Subset
- Primitive data manipulation:Numeric Casts, truncation, and rounding
- String concatenation: Using '+' operator; number conversion to String, .toString() invocation on objects
- Escape sequences: \\ , \* , \n
- User input: Using IO.readInt()
- User Output: Using System.out.print() and the System.out.println()
- The main method: Main methods are not on the Subset, but program invocation with a simple main method may occur
- 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
- Control structures: if, if/else, while, for, return
- Method overloading: Multiple functions with the same name but different signatures
- Classes: Using the new operator to construct a new object, and passing a constructor parameters
- Visibility: Public and Private
- Comments: Using comments to give information in the code
- The final keyword: Denoting that a field's value cannot be changed
- Static Methods: Utility functions that are helpful to have with a class.
- Static Final Variables: Only static final variables are in subset: other static variables are not tested
- NULL: The value of nothing
- this: Referencing the entirety of a class
- Super: Invoking a superclass constructor
- Initialization: Creating constructors that initialize all instance variables
- Subclasses: Overriding, Polymorphism, Extending, and Implementing
- Interfaces and Abstract classes: Class manipulation
- Object equality and identity: Checking content and identity
- Cloning: Cloning is not in the subset
- Finalize: The finalize method is not in the subset
- Casting (objects): Changing a class from a larger scope to a smaller scope
- Packages and Import: Organizing projects
- Inner classes: Not in the subset
- Threads: Not in the subset
- 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
- 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
|
|