AP CSA Unit 1: Primitive Types

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

String

String is a Java type that represents a string of characters (text).

2
New cards

String Literals

A sequence of characters enclosed in double quotations “ “.

3
New cards

Java Main Skeletons

Includes the class and main method arguments. Must include both in order to run successfully.

4
New cards

public static void main(String args[])

Main method. Code to be run must be placed within the main method.

5
New cards

public class MyProgram

Class. The name of MyProgram must match the name of the file.

6
New cards

System.out.print

Displays output on the computer monitor.

7
New cards

System.out.println

Displays output on the computer monitor and moves cursor to next line.

8
New cards

Variable

A symbol or container that holds a value.

9
New cards

int

int is a Java type that represents an integer (a whole number).

10
New cards

char

char is a Java type that represents a single character (a single letter).

11
New cards

double

double is a Java type that represents a real number with decimal values

12
New cards

Declare a variable

Declaring a variable is defining it for the first time.

13
New cards

Initialize a variable

Initializing a variable is giving it an initial value, or a starting value.

14
New cards

Primitive Type

Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean).

15
New cards

Boolean

A boolean is a true or false value.

16
New cards

Reference Type

Reference variables store the address of the value.

17
New cards

final

Prevents variables from changing value.

18
New cards

Modulus operator

The modulus operator (written as % in most programming languages) divides two numbers and returns the remainder.

19
New cards

Integer Division

When two integers are divided, the decimal values are truncated, or chopped off.

20
New cards

Order of Operations

The order in which mathematical expressions should be evaluated. Starts with Parentheses, Exponents, Multiplications and Division, Addition and Subtraction.

21
New cards

Literal

The fixed value being assigned to a variable. Often primitive data types.

22
New cards

ArithmeticException

Exception that is thrown to warn programmers about arithmetic errors in their code.

23
New cards

Increment

Increase the value of a variable by one. variable++;

24
New cards

Decrement

Decrease the value of a variable by one. variable–;

25
New cards

Compound Assignment Operators

Allows programmers to shortcut variable assignments that include the variable being assigned a new value: x = x + y; shortcut: x += y;