zuai-logo
zuai-logo
  1. AP Computer Science A
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion BankGlossaryGlossary

Glossary

C

Camel Casing

Criticality: 1

A naming convention where the first letter of the first word is lowercase, and the first letter of subsequent words are uppercase, with no spaces.

Example:

Naming a variable to store a user's favorite color would follow Camel Casing: String userFavoriteColor;.

D

Declaration

Criticality: 3

The process of defining a variable's data type and name before it can be used. It reserves memory for the variable.

Example:

The line int age; is a declaration that tells Java you'll be using a variable named age to store an integer.

I

Initialization

Criticality: 3

The process of assigning an initial value to a variable when it is declared or shortly thereafter. This ensures the variable has a known state.

Example:

When you write int score = 0;, you are performing initialization by giving the score variable its starting value of 0.

Integer Overflow

Criticality: 2

A condition that occurs when an arithmetic operation attempts to create a numeric value that is outside the range that can be represented by the `int` data type. The value 'wraps around' to the opposite end of the range.

Example:

If you add 1 to Integer.MAX_VALUE, instead of getting a larger number, you'll experience an Integer Overflow and get Integer.MIN_VALUE.

R

Reserved Words

Criticality: 2

Keywords in Java that have predefined meanings and cannot be used as identifiers (like variable names, method names, or class names).

Example:

You cannot name a variable class or public because these are reserved words in Java.

S

Scope

Criticality: 2

The region of a program where a variable or method can be accessed. It determines the visibility and lifetime of an identifier.

Example:

A variable declared as private has a limited scope, meaning it can only be accessed from within its own class.

String

Criticality: 3

A non-primitive (reference) data type in Java used to store sequences of characters, such as text or names.

Example:

Storing a person's full name, like 'Alice Wonderland', would be done using a String variable: String userName = "Alice Wonderland";.

Strongly Typed

Criticality: 2

A characteristic of Java where every variable must have a declared data type, and once declared, its type cannot be changed. This helps prevent type-related errors.

Example:

Because Java is strongly typed, you cannot assign a String value to an int variable after it has been declared as an int.

V

Variable

Criticality: 3

A named storage location in a program's memory that holds a value of a specific data type. Variables allow data to be stored and manipulated.

Example:

In int score = 100;, score is a variable that stores the integer value 100.

b

boolean

Criticality: 3

A primitive data type in Java that can only store one of two truth values: `true` or `false`.

Example:

To check if a user is logged in, you might use a boolean variable: boolean isLoggedIn = true;.

d

double

Criticality: 3

A primitive data type in Java used to store decimal numbers (floating-point numbers) with high precision.

Example:

Calculating a student's GPA, which often includes decimal points, requires a double variable, such as double studentGPA = 3.85;.

i

int

Criticality: 3

A primitive data type in Java used to store whole numbers (integers) without any decimal points.

Example:

To keep track of how many lives a player has left in a game, you would use an int variable like int playerLives = 3;.