Java Glossary: 57 Core Terms, Defined
Plain-English definitions of the Java language and JVM vocabulary β from JVM, JDK and bytecode to record, stream and virtual thread. Every entry is a standalone page with a short definition, a minimal code example, and links to the deeper guide.
A
- Abstract class β An abstract class in Java cannot be instantiated directly. It declares abstract methods that subclasses must implement and can also hold state and concrete methods.
- Abstraction β Abstraction in Java means hiding complexity behind a simple interface. Achieved through interfaces and abstract classes. Callers depend on "what", not "how".
- Annotation β An annotation in Java is metadata attached to code with the @ symbol. Used by frameworks (Spring, JPA, JUnit) and the compiler (@Override, @Deprecated).
- ArrayList β ArrayList is the default Java List implementation. Backed by a dynamically resizing array. O(1) get, amortised O(1) append, O(n) arbitrary insert/remove.
- Autoboxing β Autoboxing in Java automatically converts primitives to wrappers (int β Integer) and back. Silent and convenient, but watch out for NullPointerException on unboxing.
B
- Bytecode β Java bytecode is the platform-independent instruction set that the javac compiler emits. The JVM executes bytecode via interpretation and JIT compilation.
C
- Class β A class in Java is a blueprint that declares fields (state) and methods (behaviour). Objects are instances of a class, created with the new keyword.
- ClassLoader β A ClassLoader in Java loads .class files into the JVM at runtime. The hierarchy (Bootstrap β Platform β App) enables class isolation and custom loading.
- Classpath β The classpath tells the JVM where to find .class files and JARs at runtime. Set it with -cp, CLASSPATH env var, or module-path for JPMS modules.
- Collection β A Collection in Java is any group of objects β List, Set, Queue. The root interface java.util.Collection provides add, remove, contains and iteration.
- Constructor β A constructor is a special method that runs when an object is created with new. Same name as the class, no return type, used to initialise fields.
E
- Encapsulation β Encapsulation hides an object's internal state behind a controlled public interface. Private fields, public getters/setters, invariant enforcement.
- Enum β An enum in Java is a type with a fixed set of named constants. Can hold methods and fields, implement interfaces, and is type-safe by design.
- Exception β An Exception in Java is a throwable that signals an error or unexpected condition. Two categories: checked (must be declared) and unchecked (RuntimeException).
F
- final (keyword) β final in Java has three meanings: final variable (cannot be reassigned), final method (cannot be overridden), final class (cannot be subclassed).
- Functional interface β A functional interface in Java has exactly one abstract method. It can be implemented with a lambda or method reference. Examples: Runnable, Function, Predicate.
G
- Garbage collector (GC) β The garbage collector is the JVM subsystem that reclaims memory of unreachable objects. Modern collectors: G1 (default), ZGC, Shenandoah, Parallel GC.
H
- HashMap β HashMap is Java's default Map implementation. Stores key-value pairs in a hash table. Average O(1) get/put. Not thread-safe β use ConcurrentHashMap for concurrency.
- Heap (JVM memory) β The heap is the JVM memory region where all Java objects live. Managed by the garbage collector. Size tuned with -Xms and -Xmx JVM flags.
I
- Immutable object β An immutable object in Java cannot change state after construction. Achieved by making fields final, providing no setters, and ensuring defensive copies.
- Inheritance β Inheritance in Java lets a subclass extend a superclass using extends. The subclass inherits fields and methods and can override or add its own.
- Interface β An interface in Java defines a contract: a set of method signatures that implementing classes must provide. Supports default and static methods since Java 8.
- Iterator β An Iterator in Java lets you traverse a collection one element at a time with hasNext() and next(). Used by the enhanced for loop under the hood.
J
- JAR (Java Archive) β A JAR file is a zipped Java package: .class files, resources, and a MANIFEST.MF. Executable JARs include a Main-Class entry and run with java -jar.
- JavaBean β A JavaBean is a Java class following conventions: no-arg constructor, private fields, public getters and setters, and Serializable. Used by JavaBeans spec and many frameworks.
- JDK (Java Development Kit) β The JDK is the full Java developer toolkit: the JVM, the standard library, the javac compiler and diagnostic tools. Required to compile and build Java code.
- JRE (Java Runtime Environment) β The JRE bundles the JVM and the standard Java class library. It is enough to run Java programs but not to compile them. Largely superseded by full JDKβ¦
- JVM (Java Virtual Machine) β The JVM is the runtime that executes Java bytecode. It provides memory management, JIT compilation and platform independence β the foundation of "write once, run anywhere".
L
- Lambda capture / closure β A Java lambda captures effectively-final local variables from the enclosing scope. It cannot capture or mutate non-final locals.
- Lambda expression β A lambda in Java is an anonymous function expression introduced in Java 8. Used to implement functional interfaces concisely, e.g. (a, b) -> a + b.
- List β A List in Java is an ordered collection that allows duplicates and index-based access. Main implementations: ArrayList (default), LinkedList.
M
- Map β A Map in Java associates keys with values. HashMap is the default, LinkedHashMap preserves insertion order, TreeMap keeps keys sorted.
- Method β A method is a named block of code in a Java class with a return type and optional parameters. Methods expose the behaviour of objects.
- Module (JPMS) β A module in Java (since Java 9) is a higher-level grouping of packages with explicit dependencies and exports. Declared in module-info.java.
N
- NullPointerException β NullPointerException (NPE) is thrown when your code dereferences a null reference. Java 14+ helpful NPE messages pinpoint the exact null variable.
O
- Object β An object in Java is a concrete instance of a class β a chunk of heap memory holding the class's fields, accessed through a reference variable.
- Optional β Optional (Java 8+) is a container that explicitly encodes "value present or absent". Used as return type to avoid returning null and NullPointerException.
P
- Package β A Java package is a namespace for classes. Declared with package com.example; and mapped to a matching directory structure on disk.
- POJO (Plain Old Java Object) β A POJO is a simple Java class with no special framework-imposed constraints. Just fields, constructors, and getter/setter methods. Coined in contrast to EJB.
- Polymorphism β Polymorphism in Java means one reference type can refer to many concrete types. Runtime method dispatch, interface-based decoupling, method overloading.
- Primitive type β Java has 8 primitive types: byte, short, int, long, float, double, char, boolean. They hold a value directly, not a reference β unlike wrapper classes.
R
- Record β A record (Java 16+) is a compact class syntax for immutable data carriers. The compiler generates constructor, accessors, equals, hashCode and toString.
- Reflection β Reflection in Java (java.lang.reflect) lets code inspect and modify classes, methods and fields at runtime. Powers frameworks like Spring, Jackson and JUnit.
S
- Sealed class β Sealed classes (Java 17+) restrict which classes may extend them. Enables exhaustive pattern matching and algebraic-data-type style domain modelling.
- Serialization β Serialization in Java converts an object to a byte stream for storage or transmission. Built-in via Serializable and ObjectOutputStream β but JSON is preferred today.
- Set β A Set in Java is a collection that disallows duplicates. HashSet is the default, LinkedHashSet keeps insertion order, TreeSet keeps elements sorted.
- static (keyword) β static in Java marks a field or method as belonging to the class, not to instances. One copy shared by all. Used for utility methods and constants.
- Stream (Stream API) β The Stream API (Java 8+) lets you express data pipelines declaratively: filter, map, reduce, collect. Not a collection β a lazy, one-shot sequence of operations.
- String pool β The String pool is a special area in the JVM heap where String literals are interned (deduplicated). Enables a.equals(b) shortcut for identical literals.
- StringBuilder β StringBuilder is a mutable sequence of characters. Use it to concatenate many strings efficiently β avoids creating a new String per += operation.
- synchronized β The synchronized keyword in Java enforces mutual exclusion on an object monitor. Prevents race conditions on shared mutable state.
T
- this (keyword) β this in Java refers to the current object instance. Used to disambiguate fields from parameters, call other constructors, or pass the current object.
- Thread β A Thread in Java is a path of execution. Create one with new Thread(runnable) or virtual threads (Java 21). ExecutorService is the modern preferred API.
V
- var (local type inference) β var (Java 10+) is a reserved type name for local variable type inference. The compiler infers the type from the initialiser. Only for local variables.
- Varargs β Varargs (variable arguments, Java 5+) let a method accept any number of arguments of the same type. Syntax: String... names. Used by printf, Arrays.asList.
- volatile β volatile in Java guarantees that reads and writes to a variable are visible across threads. No locking β lighter than synchronized but narrower guarantees.
W
- Wrapper class β Wrapper classes in Java box a primitive type into an object: Integer wraps int, Double wraps double. Used in collections and generics via autoboxing.
How this glossary is written
Each term is defined first in one sentence anyone can paste into a code review comment without needing a paragraph of context. The page then expands with a short code example, the common misunderstandings, and a link to the long-form guide when one exists. Definitions target modern Java (17 and 21 LTS); where a term means something different on older Java (pre-9, pre-modules), the legacy meaning is called out.
Can't find a term?
Use the search box in the header, or suggest it β we prioritise additions by real search queries and reader questions. Meanwhile, most Java concepts (OOP, collections, exceptions, generics) live in the Learn Java section, and installation/licensing questions are covered in the FAQ.