JavaGlossary

Glossary

Quick definitions for terms that come up constantly across Java tutorials and job interviews. Each entry links conceptually to a deeper page elsewhere in this section — search the sidebar for the full topic if you want more than the short version.

Term

Definition

JVM (Java Virtual Machine)

The runtime engine that executes compiled Java bytecode, providing platform independence, memory management, and garbage collection.

JDK (Java Development Kit)

The full development package: compiler (javac), runtime, standard library, and tools needed to write and build Java programs.

JRE (Java Runtime Environment)

The subset of the JDK needed only to run compiled Java programs — the JVM plus standard library, without the compiler or dev tools.

Bytecode

The platform-independent instruction set that javac compiles Java source into; the JVM interprets or JIT-compiles bytecode into native machine code.

Garbage Collection

Automatic reclamation of memory used by objects that are no longer reachable from any live reference, freeing developers from manual memory management.

Autoboxing / Unboxing

Automatic conversion between a primitive type (like int) and its wrapper class (like Integer), performed implicitly by the compiler.

Generics

Compile-time type parameters (List<String>) that let classes, interfaces, and methods operate on a specified type, catching type errors at compile time instead of runtime.

Polymorphism

The ability of a variable, method, or object to take multiple forms — most commonly, calling an overridden method through a supertype reference and having the actual (subtype) implementation run.

Encapsulation

Bundling data with the methods that operate on it, and restricting direct external access to that data (typically via private fields and public getters/setters).

Inheritance

A mechanism where a subclass acquires the fields and methods of a superclass via extends, enabling code reuse and polymorphism.

Interface

A contract of method signatures (optionally with default implementations) that implementing classes agree to fulfill, without dictating how they do it.

Abstract Class

A class that cannot be instantiated directly and may contain a mix of implemented and unimplemented (abstract) methods, meant to be extended.

Lambda Expression

A compact, unnamed function ((a, b) -> a + b) that implements a functional interface's single method, introduced in Java 8.

Functional Interface

An interface with exactly one abstract method, eligible to be implemented by a lambda expression or method reference (e.g. Runnable, Comparator).

Stream

A sequence of elements supporting functional-style operations (filter, map, collect, ...) that are lazily evaluated and typically consumed once.

Immutable

Describes an object whose state cannot change after construction — String and record instances are immutable by design.

Checked Exception

An exception type (subclassing Exception but not RuntimeException) that the compiler forces calling code to either catch or declare with throws.

Unchecked Exception

An exception type (subclassing RuntimeException or Error) that the compiler does not force you to catch or declare, typically representing programming bugs.

POJO (Plain Old Java Object)

A simple class with private fields and public getters/setters, with no required inheritance from a specific framework class or interface.

Overloading

Defining multiple methods with the same name but different parameter lists in the same class, resolved by the compiler at compile time based on argument types.

Overriding

Providing a new implementation of an inherited method in a subclass, using the same signature, resolved at runtime based on the object's actual type.

Thread Safety

A property of code that behaves correctly when accessed by multiple threads concurrently, without corrupting shared state or producing race conditions.

Race Condition

A bug where the correctness of a program depends on the unpredictable timing or interleaving of multiple threads accessing shared state.

Deadlock

A situation where two or more threads are each waiting for a resource the other holds, so none of them can ever proceed.

Singleton

A design pattern guaranteeing a class has exactly one instance, accessible through a single well-known access point.

Constructor

A special method, matching the class name, that initializes a newly created object's state; invoked automatically by new.

Static

A modifier marking a field or method as belonging to the class itself rather than to any individual instance, shared across all instances.

Final

A modifier preventing further change: a final variable cannot be reassigned, a final method cannot be overridden, and a final class cannot be extended.

Package

A namespace that groups related classes and interfaces together, also used by Java to control default (package-private) access.

Annotation

Metadata attached to code (@Override, @Deprecated, @Test) that tools, the compiler, or frameworks can read and act on, without changing program logic directly.

Reflection

The java.lang.reflect API for inspecting and manipulating classes, methods, and fields at runtime, rather than at compile time.

Type Erasure

The process by which the compiler removes generic type parameter information after compile-time checking, so it does not exist at runtime.

Method Reference

A shorthand (ClassName::methodName) for a lambda that simply calls an existing method, used wherever a functional interface is expected.

Sealed Class

A class or interface (Java 17+) that explicitly restricts which other classes may extend or implement it, enabling exhaustive pattern matching.

Record

A concise class form (Java 16+) for immutable data carriers, which automatically generates a constructor, accessors, equals(), hashCode(), and toString().