Java Programming: Core Concepts, Syntax, and Control Structures

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/109

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:17 PM on 4/30/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

110 Terms

1
New cards

Encapsulation

OOP principle of bundling data and methods together and hiding implementation details inside the object

2
New cards

switch break

Exits the switch immediately after executing a case; without it execution falls through into the next case

3
New cards

toString()

Every Java object has this method; returns the String representation; called automatically in concatenation or println

4
New cards

Array default values

0 for numeric types, false for boolean, null for reference types

5
New cards

Utility/helper method

Performs internal calculations or sub-tasks; typically declared private; hidden behind the public interface; not called directly by client code

6
New cards

Client-Server

Computing model where some processes make requests (clients) and some processes grant requests (servers)

7
New cards

JavaFX

Java's modern GUI framework; uses a scene graph — Stage (window) contains a Scene which contains UI nodes

8
New cards

Gradle

Build automation tool; manages dependencies, compiles code, runs tests, packages applications; uses a build.gradle file

9
New cards

java.io

Package providing classes for reading and writing data; includes FileWriter, PrintWriter, IOException, FileReader

10
New cards

Java EE

Enterprise edition of Java used for large-scale distributed/web applications

11
New cards

Polymorphism

OOP principle where objects of different classes can be treated uniformly through a shared interface

12
New cards

javac

The Java compiler; translates .java source files into .class bytecode files

13
New cards

Compiler

Translates entire source code to bytecode before execution (javac)

14
New cards

// comment

Single-line end-of-line comment; compiler ignores it

15
New cards

Declaring a variable

type variableName; OR type variableName = value;

16
New cards

public access modifier

Accessible from any class anywhere in the program

17
New cards

Pseudocode

An informal plain-language description of an algorithm; not real code; not compilable; bridges human thinking and code

18
New cards

Infinite loop

Occurs when the loop condition is omitted or never becomes false; loop never ends

19
New cards

Method overriding

A subclass provides its own implementation of a method from its superclass with the same signature; JVM decides at runtime which version to call (runtime polymorphism)

20
New cards

Cohesion

Degree to which a method/class focuses on a single well-defined task; HIGH cohesion is good

21
New cards

Coupling

Degree to which one class/method depends on another; LOW coupling is good

22
New cards

Array

A fixed-size group of variables of the same type stored at contiguous memory locations; objects in Java (reference types)

23
New cards

Array length

Stored in array.length; fixed at creation (final variable — cannot change)

24
New cards

Jagged array

A 2D array where rows can have different lengths

25
New cards

try block

Contains code that might throw an exception

26
New cards

Accessor / getter

Reads and returns the object's state without modifying it; named getXxx() or isXxx() for booleans

27
New cards

Fat client

Client machine does most of the processing; significant local software installed; less server load but harder to update

28
New cards

Syntax error

Violation of Java's grammar rules; detected at compile time — program won't compile

29
New cards

Logic error

Program compiles and runs but produces incorrect results; algorithm is flawed; caught through testing/debugging — compiler cannot catch these

30
New cards

Java SE

Standard edition of Java used for desktop/server applications

31
New cards

Method signature

A method's name combined with its parameter list (types and order); does NOT include return type

32
New cards

switch default case

Runs when no case label matches; optional but strongly recommended

33
New cards

break (loop)

Immediately exits the entire loop (or switch); execution continues after the loop

34
New cards

Fat server

Server handles most business logic and processing; clients are lightweight/thin

35
New cards

Java ME

Micro edition of Java used for resource-constrained devices like smartwatches

36
New cards

Class

A blueprint that defines attributes and behaviors for objects

37
New cards

Object

An instance of a class; has its own attributes (instance variables) and behaviors (methods)

38
New cards

Instance variable

Data that an object carries with it; declared inside a class but outside method bodies; each object has its own copy

39
New cards

Inheritance

OOP principle where a new class reuses characteristics of an existing class

40
New cards

Public interface

A collection of method declarations (no implementation by default) that a class agrees to implement; defines a contract other classes must follow

41
New cards

java (runtime)

The JVM executor; runs compiled .class bytecode files

42
New cards

Interpreter

Translates and executes bytecode one instruction at a time at runtime, enabling platform independence (JVM)

43
New cards

main method signature

public static void main(String[] args) — must be exact

44
New cards

/ / comment

Traditional multi-line comment; compiler ignores everything between the delimiters

45
New cards

/* / comment

Javadoc comment; used to generate HTML documentation via the javadoc utility

46
New cards

print

Outputs text; cursor stays on the same line

47
New cards

println

Outputs text and moves cursor to the next line

48
New cards

printf

Formatted output using format specifiers like %s (String), %d (integer), %f (float)

49
New cards

Scanner class

From java.util; reads input from a source (keyboard = System.in or a file); methods include nextLine(), next(), nextInt(), nextDouble()

50
New cards

java.lang package

The default Java package; automatically imported into every program; contains String, System, Math, Integer, Object

51
New cards

Constructor

A special method used to initialize a new object; same name as the class; no return type; called automatically with new

52
New cards

Default constructor

Provided automatically by the compiler only if you declare NO constructors; initializes fields to default values (0, false, null)

53
New cards

private access modifier

Accessible only within the class it is declared in; used for instance variables and helper methods

54
New cards

protected access modifier

Accessible from the same class, same package, and subclasses

55
New cards

Package-private (no modifier)

Accessible only by classes in the same package

56
New cards

Driver class

Contains the main() method; drives/runs the program; used for testing and launching

57
New cards

Helper class

Contains the actual logic, data, and behavior; does the real work; called upon by the driver

58
New cards

UML Class diagram

Visual showing a class's name (top), fields with types (middle), and methods with signatures (bottom); + = public, - = private, # = protected

59
New cards

Algorithm

A finite, unambiguous, effective step-by-step set of instructions that solves a problem; language-independent

60
New cards

final variable (constant)

Declared with keyword final; set once and cannot be changed; convention is ALL_CAPS_WITH_UNDERSCORES; attempting to modify causes a compile-time error

61
New cards

Sequence (control)

Execute statements one after another in the order they appear; the default flow

62
New cards

Selection (control)

Choose a path of execution based on a condition; Java has three selection statements (if, if-else, switch)

63
New cards

Iteration (control)

Repeat a block; Java has four iteration statements (for, while, do-while, enhanced for)

64
New cards

Switch limitation

Cannot test ranges; every discrete value needs its own case; use if-else for range checks like score >= 90

65
New cards

for loop syntax

for (initialization; loopContinuationCondition; increment) { body }

66
New cards

while loop

Condition tested BEFORE the body runs; body may never execute (0 or more times)

67
New cards

do...while loop

Condition tested AFTER the body runs; body always executes at least once

68
New cards

Counter-controlled iteration

You know in advance how many times to repeat; uses a counter with a known start, end, and increment

69
New cards

Sentinel-controlled iteration

Repeat until a special sentinel value signals the end; you don't know in advance how many iterations will occur

70
New cards

continue (loop)

Skips the rest of the current iteration and jumps to the next one; in for loops the increment still runs

71
New cards

Method overloading

Multiple methods in the same class share the same name but have different parameter lists; compiler selects the right version at compile time (compile-time polymorphism)

72
New cards

3 ways to call a method

(1) method name only (same class), (2) object reference + dot (instance method), (3) class name + dot (static method)

73
New cards

3 ways to return control

(1) end brace of void method, (2) return; with no value (void method), (3) return expression; (non-void method)

74
New cards

ArrayIndexOutOfBoundsException

Runtime exception thrown when accessing an out-of-bounds array index

75
New cards

Array initializer list

Skip new keyword; use comma-separated values in braces: int[] primes = {2, 3, 5, 7, 11};

76
New cards

2D array

An array of arrays — rows and columns like a spreadsheet; access with grid[row][col]; traverse with nested for loops

77
New cards

ArrayList vs Array — size

Array: fixed size set at creation. ArrayList: dynamic — grows/shrinks automatically

78
New cards

ArrayList vs Array — primitives

Array: can hold primitives OR objects. ArrayList: can only hold objects (use Integer, Double, etc.)

79
New cards

ArrayList vs Array — length/size

Array uses .length; ArrayList uses .size()

80
New cards

ArrayList vs Array — access

Array uses arr[i]; ArrayList uses list.get(i)

81
New cards

throw (exceptions)

A method detects an invalid condition, creates a new exception object, and throws it; immediately terminates the method

82
New cards

catch (exceptions)

A try-catch block catches a thrown exception so the program handles it gracefully instead of crashing

83
New cards

catch block

Immediately follows try; if an exception is thrown, execution jumps here; multiple catch blocks can follow one try

84
New cards

Mutator / setter

Modifies the object's state; named setXxx(); returns void; should validate the new value before storing

85
New cards

Database

A single repository of logically related data

86
New cards

Relational data model

Data structured as a collection of logically related tables; tables related through foreign keys; most widely used data model worldwide; supports 1:1 and 1:M relationships

87
New cards

Primary key (PK)

Unique identifier (one or more attributes) for each row in a table; enforces entity integrity

88
New cards

Foreign key (FK)

One or more attributes that create a relationship between tables; refers to the PK of the other table; data types must match; enforces referential integrity

89
New cards

DBMS

Database Management System — software (e.g., SQLite, MySQL, Oracle) that creates, manages, and interacts with the database

90
New cards

DBMS vs Database

Database = the actual stored data; DBMS = the software that manages it

91
New cards

CRUD

Create, Read (retrieve), Update, Delete — the four basic database operations

92
New cards

SQLite

Small, fast, self-contained SQL database engine; no separate server process needed; most popular embedded SQL database worldwide

93
New cards

Thin client

Client does minimal processing; most logic runs on the server; easy to maintain centrally but more server-dependent

94
New cards

Thin server

Server does minimal work (e.g., just stores/retrieves data); clients handle more processing

95
New cards

Runtime error

Program compiles but crashes during execution; detected when the program runs

96
New cards

Modal dialog box

Blocks all interaction with the application until the user dismisses it; user MUST respond before doing anything else

97
New cards

Modeless dialog box

Does NOT block other interactions; user can continue working while the dialog is open

98
New cards

SceneBuilder

Visual drag-and-drop tool for designing JavaFX UIs; generates FXML files

99
New cards

java.util.Scanner

Reads input from various sources; methods: nextInt(), nextDouble(), next(), nextLine(), hasNext()

100
New cards

java.io.FileWriter

Writes characters to a file; usually wrapped in PrintWriter