CPS 209 Lecture 1 – From Python to Java

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/30

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards summarizing core Java terminology, syntax, and concepts introduced in CPS 209 Lecture 1.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

Java Virtual Machine (JVM)

Runtime environment that executes Java bytecode, allowing the same program to run on many operating systems.

2
New cards

Java Development Kit (JDK)

Package that supplies the Java compiler, standard libraries, and developer tools required to build Java programs.

3
New cards

static typing

Rule that every variable and expression has a fixed, known type at compile time; type errors are caught before the program runs.

4
New cards

primitive data type (Java)

One of Java’s eight built-in value types—byte, short, int, long, float, double, char, boolean—that store simple data and have no methods.

5
New cards

byte (Java)

8-bit signed integer primitive; range −128 to 127.

6
New cards

char (Java)

16-bit unsigned primitive that stores a single Unicode character (0–65 535).

7
New cards

int (Java)

32-bit signed integer primitive; range −2 147 483 648 to 2 147 483 647.

8
New cards

long (Java)

64-bit signed integer primitive; range −9 223 372 036 854 775 808 to 9 223 372 036 854 775 807.

9
New cards

float (Java)

32-bit IEEE-754 single-precision floating-point primitive.

10
New cards

double (Java)

64-bit IEEE-754 double-precision floating-point primitive (same format Python uses for floats).

11
New cards

boolean (Java)

Primitive type that can hold only the values true or false.

12
New cards

overflow

Condition where an arithmetic result exceeds the numeric range of its type, causing wrap-around (e.g., huge int sums becoming negative).

13
New cards

main() method (Java)

public static void main(String[] args) – the entry point where a standalone Java program starts execution.

14
New cards

public (Java keyword)

Access modifier that makes a class, method, or field visible from any other class.

15
New cards

static (Java keyword)

Marks a member as belonging to the class itself rather than to instances; can be accessed without creating an object.

16
New cards

void (Java keyword)

Return-type specifier indicating a method returns no value.

17
New cards

System.out.println()

Standard library call that prints a line of text to the console; part of the PrintStream object out inside the System class.

18
New cards

String literal

Sequence of characters delimited by double quotes in Java source code, e.g., "Hello".

19
New cards

concatenation operator (+)

When at least one operand is a String, + joins the strings together instead of performing numeric addition.

20
New cards

type mismatch

Compile-time error that occurs when an expression’s type is incompatible with what the context expects.

21
New cards

control structure

Language construct such as if-else, switch, for, while, or do-while that alters the normal sequential flow of execution.

22
New cards

if-else statement (Java)

Selection structure that executes one block when a Boolean condition is true and an optional block when it is false.

23
New cards

switch statement

Multi-branch selection structure that chooses a block to execute based on the value of an integral or char expression.

24
New cards

case label (switch)

Specific value inside a switch that is compared to the control expression; followed by code and usually ended by break.

25
New cards

break (switch/loop)

Keyword that exits the nearest switch or loop immediately, preventing further fall-through or iterations.

26
New cards

for loop (Java)

Count-controlled loop with initialization; condition; update clauses executed in that order each iteration.

27
New cards

while loop

Pre-test loop that repeats its body as long as its Boolean condition evaluates to true before each iteration.

28
New cards

do-while loop

Post-test loop that executes its body once, then repeats while the condition remains true.

29
New cards

operator precedence (Java)

Hierarchy that determines the order in which operators are evaluated; parentheses override the default order.

30
New cards

logical operators

&& (AND), || (OR), and ! (NOT) used to combine or invert Boolean expressions.

31
New cards

printf (Java)

Formatted-output method that uses C-style specifiers (e.g., %s, %d, %.2f) to produce formatted text.