AP Computer Science A 50 Flashcards Beginner 100% Free

AP Computer Science A:: Primitive Types

Created by Chat Robotics Community  ·  Updated 2026-08-30

Curriculum Overview

Comprehensive, high-yield AP Computer Science A study deck focusing on Primitive Types. Features 50 rigorous, curriculum-aligned flashcards designed for beginner-level mastery. Core concepts covered include Computer Science, key problem-solving heuristics, foundational formulas, and exam-tested application scenarios. Ideal for active recall review, spaced repetition study, and scoring in the top percentile.

Topics & Key Concepts

Java They This FIRST Java's String Integer Science Computer Evaluate

Sample Flashcard Questions & Answers

Showing 8 of 50 cards
Question #1 Active Recall

Which of the following are the THREE primitive data types most commonly used in AP Computer Science A?

- **A)** \(class\), \(void\), and \(public\)
- **B)** \(String\), \(int\), and \(ArrayList\)
- **C)** \(int\), \(double\), and \(boolean\)
- **D)** \(Integer\), \(Double\), and \(Boolean\) (capitalized)

Answer & Explanation:
**Answer: C)**

\(int\) (whole numbers), \(double\) (decimal numbers), and \(boolean\) (true/false) are the core primitive types tested on the AP exam; note \(String\) is actually a class (reference type), not a primitive.
Question #2 Active Recall

What is the key difference between a PRIMITIVE type (like \(int\)) and a REFERENCE type (like \(String\)) in Java?

- **A)** A primitive variable directly stores its actual value, while a reference type variable stores the MEMORY ADDRESS (reference) of an object, not the object's data itself
- **B)** Primitive types and reference types are stored identically in memory with no distinction
- **C)** Primitive types always require the \(new\) keyword to create
- **D)** Reference types can never be used in Java programs

Answer & Explanation:
**Answer: A)**

This distinction is foundational to understanding Java's memory model: primitives hold values directly, while reference types hold a pointer to an object elsewhere in memory.
Question #3 Active Recall

Which of the following is a valid variable declaration and initialization in Java?

- **A)** \(5\ int\ x;\)
- **B)** \(int\ x = 5;\)
- **C)** \(int\ 5 = x;\)
- **D)** \(x\ int = 5;\)

Answer & Explanation:
**Answer: B)**

Java syntax requires the type first, then the variable name, then an optional assignment: \(type\ name = value;\).
Question #4 Active Recall

What value is stored in \(x\) after executing \(int\ x = 7 / 2;\)?

- **A)** \(3\)
- **B)** \(3.5\)
- **C)** \(3.0\)
- **D)** \(4\)

Answer & Explanation:
**Answer: A)**

Integer division in Java truncates (discards) the decimal portion of the result, so \(7/2\) evaluates to \(3\), not \(3.5\).
Question #5 Active Recall

What value is stored in \(x\) after executing \(double\ x = 7 / 2;\)?

- **A)** This code does not compile
- **B)** \(4.0\)
- **C)** \(3.0\), since both operands (7 and 2) are still \(int\) literals, so integer division occurs FIRST (giving 3), and only THEN is the int result 3 widened to the double 3.0 for assignment
- **D)** \(3.5\), since \(x\) is declared as \(double\)

Answer & Explanation:
**Answer: C)**

A very commonly tested trap: declaring the VARIABLE as \(double\) does NOT change how the expression \(7/2\) itself is evaluated -- since both literals are \(int\), integer division happens first.
Question #6 Active Recall

What value is stored in \(x\) after executing \(double\ x = 7.0 / 2;\)?

- **A)** \(3.0\)
- **B)** \(3.5\)
- **C)** \(3\)
- **D)** \(4.0\)

Answer & Explanation:
**Answer: B)**

Since one operand (7.0) is already a \(double\), the entire expression is evaluated using floating-point (real) division, giving the expected \(3.5\).
Question #7 Active Recall

What does the MODULUS operator \(\%\) compute in Java?

- **A)** The absolute value of the difference between two numbers
- **B)** The result of dividing the two operands as decimals
- **C)** The percentage of one number relative to another
- **D)** The remainder after integer division of the left operand by the right operand

Answer & Explanation:
**Answer: D)**

The modulus operator returns whatever is 'left over' after dividing as far as possible using whole numbers -- extremely useful for checking even/odd, wraparound, and similar patterns.
Question #8 Active Recall

Evaluate \(17 \% 5\) in Java.

- **A)** \(3.4\)
- **B)** \(12\)
- **C)** \(3\)
- **D)** \(2\)

Answer & Explanation:
**Answer: D)**

\(17 = 3 \times 5 + 2\), so the remainder (and thus \(17\%5\)) is \(2\).

Want to study all 50 flashcards with spaced repetition?

Practice with Anki-style scheduling, Hands-Free audio commute mode, and AI Tutor explanations.

Start Studying Full Deck Now

How You Can Study This Deck on Chat Robotics

Anki Spaced Repetition (SRS)

Algorithms schedule review intervals automatically so you retain 90%+ in minimum study time.

Hands-Free Audio Commute Mode

High-fidelity Neural Text-To-Speech reads questions and answers aloud with customizable delay timers.

Built-in AI Tutor Assistant

Stuck on a tricky concept? Click "Ask AI" on any card to receive instant deep-dive step-by-step explanations.

Subdeck & Tag Organization

Organize and filter by topic tags or drill entire subdeck hierarchies sequentially in Subdeck Scheduler.