AP CSA Unit 1: Primitive Types

studied byStudied by 2 people
0.0(0)
Get a hint
Hint

String

1 / 24

25 Terms

1

String

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

New cards
2

String Literals

A sequence of characters enclosed in double quotations “ “.

New cards
3

Java Main Skeletons

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

New cards
4

public static void main(String args[])

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

New cards
5

public class MyProgram

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

New cards
6

System.out.print

Displays output on the computer monitor.

New cards
7

System.out.println

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

New cards
8

Variable

A symbol or container that holds a value.

New cards
9

int

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

New cards
10

char

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

New cards
11

double

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

New cards
12

Declare a variable

Declaring a variable is defining it for the first time.

New cards
13

Initialize a variable

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

New cards
14

Primitive Type

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

New cards
15

Boolean

A boolean is a true or false value.

New cards
16

Reference Type

Reference variables store the address of the value.

New cards
17

final

Prevents variables from changing value.

New cards
18

Modulus operator

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

New cards
19

Integer Division

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

New cards
20

Order of Operations

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

New cards
21

Literal

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

New cards
22

ArithmeticException

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

New cards
23

Increment

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

New cards
24

Decrement

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

New cards
25

Compound Assignment Operators

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

New cards

Explore top notes

note Note
studied byStudied by 9190 people
... ago
4.8(30)
note Note
studied byStudied by 183 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 11 people
... ago
5.0(1)
note Note
studied byStudied by 26 people
... ago
5.0(1)
note Note
studied byStudied by 79 people
... ago
4.8(4)
note Note
studied byStudied by 14 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(2)

Explore top flashcards

flashcards Flashcard (43)
studied byStudied by 14 people
... ago
5.0(1)
flashcards Flashcard (70)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (40)
studied byStudied by 23 people
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 16 people
... ago
5.0(1)
flashcards Flashcard (47)
studied byStudied by 3 people
... ago
5.0(1)
flashcards Flashcard (29)
studied byStudied by 3 people
... ago
5.0(1)
flashcards Flashcard (86)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (108)
studied byStudied by 19 people
... ago
5.0(1)
robot