Java Programming — 80 Definitions of Terms
Java Programming
80 Definitions of Terms
This document covers 80 essential Java programming terms organized into 10 categories: Object-Oriented
Programming (OOP), Syntax, Types, Control Flow, Memory & JVM, Collections, Exceptions, Concurrency, I/O,
and Advanced features.
# Term Definition
OOP
1 Class A blueprint or template that defines the properties (fields) and
behaviors (methods) of objects. All Java code must reside inside a
class.
2 Object An instance of a class created with the new keyword. Each object
holds its own copy of the class's fields and can invoke its methods.
3 Inheritance A mechanism where a child class (subclass) acquires the fields and
methods of a parent class (superclass) using the extends keyword.
4 Polymorphism The ability of one reference type to behave differently depending on the
actual object it points to, enabling method overriding and interface
substitution.
5 Encapsulation The practice of hiding internal data by making fields private and
exposing them only through public getter and setter methods to control
access.
6 Abstraction Hiding implementation details and exposing only essential features.
Achieved in Java through abstract classes and interfaces.
7 Interface A contract that specifies what methods a class must implement,
declared with the interface keyword. A class can implement multiple
interfaces.
8 Abstract Class A class declared with abstract that cannot be instantiated directly and
may contain abstract (unimplemented) methods subclasses must
override.
9 Constructor A special method with the same name as the class and no return type,
called automatically when an object is created with new to initialize its
state.
10 Method A named block of code inside a class that performs a specific task.
Methods may accept parameters and optionally return a value.
11 Method Providing a new implementation of a method inherited from a
Overriding superclass using the same signature. Annotated with @Override for
compile-time safety.
12 Method Defining multiple methods in the same class with the same name but
Overloading different parameter lists. The compiler selects the correct version at
compile time.
13 super A keyword referring to the immediate parent class. Used to call the
parent constructor (super()) or access a parent method hidden by
overriding.
Page 1 of 6
Java Programming — 80 Definitions of Terms
14 this A reference to the current object inside an instance method or
constructor. Distinguishes instance fields from local variables with the
same name.
Syntax
15 static A modifier that makes a field or method belong to the class itself rather
than to any instance. Static members are shared across all objects.
16 final A modifier preventing a variable from being reassigned, a method from
being overridden, or a class from being extended.
17 main Method The entry point of every Java application: public static void
main(String[] args). The JVM calls this method to begin program
execution.
18 Package A namespace that organizes related classes and interfaces into a
folder hierarchy, declared with the package keyword at the top of a
source file.
19 import A directive allowing the use of classes from other packages without
their full path. Example: import [Link]; or import [Link].*;
20 Access Modifier Keywords controlling visibility: public (everyone), protected (package +
subclasses), package-private (default, same package), and private
(same class only).
21 Annotation Metadata attached to code elements using the @ symbol. Examples:
@Override, @Deprecated, @FunctionalInterface. Processed at
compile time or runtime.
22 instanceof An operator that tests whether an object is an instance of a given class
or interface, returning true or false. Used before casting to avoid
ClassCastException.
Types
23 int A 32-bit signed integer primitive type holding values from -
2,147,483,648 to 2,147,483,647. The most commonly used numeric
type in Java.
24 double A 64-bit floating-point primitive type for decimal numbers. Trades exact
precision for wide range; use BigDecimal for precise financial
calculations.
25 boolean A primitive type that holds only true or false. The standard type for
conditions, loop guards, and flag variables throughout Java programs.
26 char A 16-bit unsigned primitive representing a single Unicode character,
written with single quotes: char c = 'A';. Useful for character
manipulation.
27 String An immutable sequence of characters implemented as a class (not a
primitive). String literals are cached in the string pool to conserve heap
memory.
28 long A 64-bit signed integer primitive for values too large for int. Literals
must end with L: long big = 9_000_000_000L; Uses 8 bytes of memory.
29 byte An 8-bit signed primitive holding values from -128 to 127. Commonly
used for raw binary data, file streams, and memory-efficient byte
arrays.
Page 2 of 6
Java Programming — 80 Definitions of Terms
30 short A 16-bit signed primitive holding values from -32,768 to 32,767. Rarely
used in modern Java; mainly in legacy protocol or file format headers.
31 float A 32-bit single-precision floating-point type. Less precise than double;
literals require the F suffix: float f = 3.14f; Usually avoided in favor of
double.
32 Casting Explicitly converting a value from one type to another. Widening cast
(int to long) is automatic; narrowing cast (double to int) requires a
(type) prefix.
33 Wrapper Class Object versions of primitives: Integer, Double, Boolean, etc. Required
when using generics or collections that can only store object
references.
34 Autoboxing The automatic conversion from a primitive to its wrapper class (e.g., int
to Integer) performed by the compiler when placing primitives into
collections.
35 var Local variable type inference introduced in Java 10. The compiler infers
the type from the initializer: var list = new ArrayList<String>(); Reduces
verbosity.
Control Flow
36 if / else Conditional branching. The if block executes when the condition is true;
the optional else block executes when it is false. Branches may be
nested.
37 switch A multi-branch statement comparing a variable against constant case
labels and executing the matching branch. Each case should end with
break to prevent fall-through.
38 for Loop A loop with an initializer, condition, and update expression. Best when
the number of iterations is known in advance: for (int i = 0; i < n; i++).
39 while Loop A loop that checks its condition before each iteration. Runs zero or
more times; appropriate when the number of iterations is not known
beforehand.
40 do-while Loop A loop that executes its body at least once before checking the
condition. Useful for menu-driven programs requiring at least one cycle
of execution.
41 for-each Loop An enhanced for loop (for (Type item : collection)) that iterates over
arrays or Iterable objects cleanly without managing an index variable.
42 break Immediately exits the nearest enclosing loop or switch statement,
transferring control to the statement that follows the loop or switch
block.
43 continue Skips the remaining statements in the current loop iteration and jumps
to the loop's update expression (for) or condition check (while/do-
while).
44 return Exits the current method and optionally returns a value to the caller. A
void method may use a bare return; statement to exit early.
45 Ternary Operator A compact conditional expression: condition ? valueIfTrue :
valueIfFalse. Equivalent to a simple if/else but usable inside larger
expressions.
Memory / JVM
Page 3 of 6
Java Programming — 80 Definitions of Terms
46 JVM Java Virtual Machine — the runtime engine that loads, verifies, and
executes Java bytecode, providing platform independence (write once,
run anywhere).
47 JDK Java Development Kit — the full development package including the
compiler (javac), JVM, debugger, and standard libraries needed to
write and run Java programs.
48 JRE Java Runtime Environment — a subset of the JDK containing only the
JVM and core libraries, sufficient to run (but not compile) Java
programs.
49 Heap The JVM memory region where all objects created with new are stored.
Managed by the garbage collector, which automatically reclaims
unreachable objects.
50 Stack A per-thread memory region storing method call frames, local
variables, and return addresses. Memory is freed automatically when a
method returns.
51 Garbage The JVM subsystem that automatically finds and frees heap memory
Collector occupied by objects with no live references, preventing manual
memory management and leaks.
52 null A literal meaning 'no object reference.' Any reference variable can hold
null. Dereferencing a null reference throws a NullPointerException at
runtime.
53 new Keyword Allocates a new object on the heap, calls the matching class
constructor, and returns a reference to the new object: Dog d = new
Dog('Rex');
54 Bytecode Compiled Java code in .class files — a platform-neutral instruction set
executed by the JVM. It is neither machine code nor source code.
Collections
55 ArrayList A resizable array implementation of the List interface. Allows indexed
access in O(1) time and grows automatically when new elements are
added.
56 LinkedList A doubly-linked list implementing both List and Deque. Efficient O(1)
insertions and deletions at the ends, but O(n) for random index access.
57 HashMap A hash table implementation of the Map interface storing key-value
pairs. Offers average O(1) get and put; keys must implement
hashCode() and equals().
58 HashSet A Set backed by a HashMap that stores only unique elements with no
guaranteed order. Provides average O(1) add, remove, and contains
operations.
59 Stack (class) A LIFO (last-in, first-out) data structure. push() adds to the top; pop()
removes from the top. ArrayDeque is preferred in modern Java code.
60 Queue A FIFO (first-in, first-out) interface. offer() adds to the tail; poll()
removes from the head. Implemented by LinkedList and ArrayDeque.
61 Iterator An object traversing a collection one element at a time via hasNext()
and next(). Allows safe element removal during iteration using
remove().
62 Generics A feature parameterizing classes and methods by type (e.g.,
Page 4 of 6
Java Programming — 80 Definitions of Terms
List<String>). Enforces type safety at compile time and eliminates
unsafe casting.
63 Collections A utility class in [Link] providing static methods for sorting (sort()),
Class binary searching (binarySearch()), and shuffling (shuffle()) collections.
Exceptions
64 Exception An event that disrupts normal program flow. In Java, exceptions are
objects extending Throwable, carrying a message, cause, and stack
trace.
65 try-catch A structure enclosing risky code in a try block and catching specific
exceptions in matching catch clauses to prevent abrupt program
termination.
66 finally An optional block after try/catch that always executes regardless of
whether an exception occurred. Used to release resources like file
handles or connections.
67 throw A keyword that explicitly raises an exception: throw new
IllegalArgumentException("Value must be positive"); Immediately
transfers control to the nearest handler.
68 throws A method signature keyword declaring which checked exceptions the
method may propagate to callers, who must then handle or re-declare
them.
69 Checked An exception the compiler requires you to handle or declare. Examples
Exception include IOException and SQLException. Extends Exception but not
RuntimeException.
70 Unchecked An exception not required by the compiler to be caught, usually
Exception indicating programming errors. Examples: NullPointerException,
ArrayIndexOutOfBoundsException.
71 try-with- A try statement that automatically closes objects implementing
resources AutoCloseable when the block exits, replacing the need for explicit
finally cleanup code.
Concurrency
72 Thread The smallest unit of CPU execution in Java. Created by extending
Thread or implementing Runnable, then calling start() to begin
concurrent execution.
73 Runnable A functional interface with a single run() method. Preferred over
extending Thread because it separates the task logic from the
execution mechanism.
74 synchronized A keyword restricting a method or block to one thread at a time,
preventing race conditions when multiple threads access shared
mutable state.
75 volatile A field modifier ensuring all threads always read the latest written value
from main memory, preventing stale cached reads without full
synchronization.
76 ExecutorService A higher-level concurrency API managing a pool of worker threads.
submit() queues tasks; shutdown() signals the pool to stop after
completing queued work.
Page 5 of 6
Java Programming — 80 Definitions of Terms
I/O
77 FileReader A character-based class for reading text files. Wraps a FileInputStream
and decodes bytes using the platform's default charset or a specified
encoding.
78 BufferedReader Wraps a Reader to add buffering and the readLine() method,
dramatically reducing the number of actual disk I/O operations during
text file reading.
79 Serialization The process of converting an object's state to a byte stream (via
ObjectOutputStream) so it can be saved to disk or sent over a network
and later reconstructed.
Advanced
80 Lambda An anonymous function written as (parameters) -> body that
Expression implements a functional interface inline, eliminating verbose
anonymous class syntax introduced in Java 8.
Page 6 of 6