SAT / PSAT
SAT / PSAT Prep
History & Social Science
AP World History AP US History AP European History AP Human Geography AP US Government & Politics AP Psychology AP Macroeconomics AP Microeconomics
English
AP English Language & Composition AP English Literature & Composition
Math & Computer Science
AP Calculus AB/BC AP Precalculus AP Statistics AP Computer Science A AP Computer Science Principles
Sciences
AP Biology AP Chemistry AP Environmental Science AP Physics 1 AP Physics 2
World Languages & Arts
AP Spanish Language AP Art History AP Music Theory Start studying →
Unit 1 · Using Objects & Methods Flashcards Cheat Sheet Essentials Visual Review MC Practice FRQ Practice

AP Computer Science A Unit 1 Cheat Sheet

A one-page visual summary of Using Objects and Methods — every type, operator, method call, and exam trap you need, on a single screen.

← Back to Unit 1 hub

The basics

What it covers: Java data types, expressions and output, casting, operators, the API, method signatures, objects, and the Math and String classes.

Exam weight: About 15–25% of the multiple-choice section.

The big question: How do you store data, build expressions, and use objects and methods in Java?

Computational thinking practices: Design Code, Develop Code, Analyze Code, Document Code, and Use Computers Responsibly.

Key topics at a glance

Primitive Types

int (integers), double (real numbers), boolean (true/false). Everything else is a reference type (objects like String).

Arithmetic & Precedence

Operators + − * / %. Precedence: * / % before + −; parentheses first; equal precedence goes left to right.

Integer vs. Double Division

int / int truncates (7 / 2 = 3). Use a (double) cast for real division: (double) 7 / 2 = 3.5. % gives the remainder.

Output

System.out.print(x) stays on the line; System.out.println(x) adds a new line.

Casting

(int) truncates a double toward zero; (double) makes an int a real number. Cast can lose information or overflow the int range.

Compound & Increment

+= -= *= /= %= combine an operation with assignment. ++ adds 1, −− subtracts 1.

Calling Methods

Class.method(args) for static (Math.sqrt); object.method(args) for instance (str.length()). Use the dot operator.

Strings

A String is immutable. Concatenate with +. Methods: length(), substring(from, to), indexOf(str), equals(other), compareTo(other). Indices start at 0.

The key terms and rules you must know

Key themes to remember

Common exam traps