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 17 people
... ago
5.0(1)
note Note
studied byStudied by 208 people
... ago
5.0(2)
note Note
studied byStudied by 13 people
... ago
5.0(1)
note Note
studied byStudied by 8 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 8 people
... ago
5.0(1)
note Note
studied byStudied by 36 people
... ago
5.0(1)
note Note
studied byStudied by 1806 people
... ago
4.7(6)

Explore top flashcards

flashcards Flashcard (105)
studied byStudied by 8 people
... ago
5.0(1)
flashcards Flashcard (119)
studied byStudied by 8 people
... ago
5.0(1)
flashcards Flashcard (21)
studied byStudied by 12 people
... ago
5.0(1)
flashcards Flashcard (121)
studied byStudied by 13 people
... ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (77)
studied byStudied by 156 people
... ago
4.8(5)
flashcards Flashcard (48)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (159)
studied byStudied by 1982 people
... ago
4.5(13)
robot