Oracle Java Foundations key terms
Oracle Java Foundations · Get comfortable with the vocabulary.
- JDK
- Related: JVM, bytecode
The Java Development Kit: the installable bundle of tools used to write and build Java programs, including the compiler javac and the runtime. Developers need it to compile source files into class files.
- JVM
- Related: JDK, bytecode
The Java Virtual Machine: the engine that loads and executes compiled Java class files. It manages memory and garbage collection and lets the same compiled program run on different operating systems.
- bytecode
- Related: JVM, JDK
The platform-neutral instruction set produced by compiling Java source files into .class files. A virtual machine translates or interprets these instructions for the underlying hardware at run time.
- main method
- Related: static member
The starting point the virtual machine looks for when launching a standalone program, declared as public static void main(String[] args). A different signature means the program cannot be started.
- package
A named grouping of related classes and interfaces that also maps to a folder structure. Declaring a package avoids name collisions and lets classes be imported and reused by other code.
- primitive type
- Related: reference type, autoboxing
One of the eight built-in, non-object types - byte, short, int, long, float, double, char, and boolean - whose variables hold a single value directly rather than pointing to an object.
- reference type
- Related: primitive type, casting
A type whose variable stores the location of an object on the heap instead of the object's values. Classes, interfaces, arrays, and enums are all reference types.
- autoboxing
- Related: wrapper class, primitive type
The compiler's automatic wrapping of a primitive value into its matching object type, and the reverse unwrapping. It lets primitives be stored in collections and passed where objects are required.
- wrapper class
- Related: autoboxing
A class such as Integer, Double, or Character that holds one primitive value inside an object. Wrapper classes also supply parsing and utility methods such as Integer.parseInt.
- casting
- Related: reference type
An explicit instruction, written as (Type) value, that converts a value to another type. Narrowing between primitives can lose information, and a wrong reference cast fails at run time.
- operator precedence
- Related: short-circuit evaluation
The rule set that decides which operator in an expression is applied first when parentheses are absent. Multiplicative operators bind more tightly than additive ones, and assignment is the loosest.
- short-circuit evaluation
- Related: operator precedence
How the && and || operators behave: the right-hand operand is skipped when the left-hand operand already settles the result. This also guards against evaluating risky expressions.
- switch statement
- Related: break / continue
A branching construct that compares one value against several case labels and runs the matching block. Selectors may be integer types, char, String, or enum constants, and blocks fall through without a break.
- reference equality (==)
- Related: equals method
The test the == operator performs on objects: it is true only when both variables refer to the exact same object in memory, not when two separate objects hold equal contents.
- array
- Related: enhanced for loop
A container holding a fixed number of values of one type, accessed by an integer position starting at zero. Its length is set when it is created and cannot change afterward.
- for loop
- Related: while loop, enhanced for loop
A loop whose header holds an initialization, a continuation condition, and an update step, making it the natural choice when the number of repetitions is known in advance.
- enhanced for loop
- Related: for loop, array
A shorthand loop that visits every element of an array or collection in order without an explicit index or counter. It cannot easily remove elements while iterating.
- while loop
- Related: do-while loop, for loop
A loop that tests its condition before each pass, so the body runs zero or more times and repeats as long as the condition stays true.
- do-while loop
- Related: while loop
A loop that runs its body first and checks the condition afterward, guaranteeing at least one execution. The condition is followed by a semicolon.
- break / continue
- Related: for loop, switch statement
Loop and switch control keywords: break leaves the innermost loop or switch immediately, while continue abandons the current pass and begins the next iteration.
- method signature
- Related: method overloading
The name of a method together with the number and types of its parameters, in order. The return type and parameter names are not part of it.
- method overloading
- Related: method signature, method overriding
Declaring several methods in one class with the same name but different parameter lists. The compiler chooses among them based on the argument types it sees.
- access modifier
- Related: encapsulation
A keyword that sets visibility: private (class only), default or package-private, protected (package plus subclasses), and public (everywhere). It is how encapsulation is enforced in code.
- encapsulation
- Related: access modifier
Hiding an object's fields behind private access and exposing only methods that read or change them safely, so internal state cannot be corrupted from outside.
- constructor
- Related: this keyword
A block that initializes a new object when new is used. It carries the class's name and no return type; if none is declared, the compiler supplies a no-argument one.
- this keyword
- Related: constructor
Inside an instance method or constructor, a reference to the object currently in use. It resolves name clashes between fields and parameters and can chain one constructor to another.
- static member
- Related: main method
A field or method declared with the static keyword that belongs to the class itself rather than to any instance, is shared by all objects, and can be called without creating one.
- extends / inheritance
- Related: method overriding, polymorphism
The keyword by which a class names its superclass and inherits its accessible fields and methods. Java permits a class to have only one direct superclass.
- method overriding
- Related: polymorphism, method overloading
Supplying a new implementation in a subclass for an inherited method with the same signature. Which version executes is decided by the actual type of the object at run time.
- polymorphism
- Related: method overriding, abstract class
The ability to treat objects of different subclasses through a common supertype reference, so that a single method call runs the implementation belonging to the actual object.
- abstract class
- Related: interface, polymorphism
A class marked abstract that cannot be instantiated and may declare methods with no body. A concrete subclass must implement those methods, or itself be declared abstract.
- interface
- Related: abstract class
A reference type that declares method signatures implementing classes promise to provide. A class may implement several interfaces, which gives a form of multiple inheritance of type.
- checked exception
- Related: unchecked exception, throws clause
An exception, other than a runtime one, that the compiler forces you to deal with by catching it or by declaring it in a throws clause.
- unchecked exception
- Related: checked exception
An exception descending from RuntimeException, such as NullPointerException, that the compiler does not require you to catch or declare. It usually signals a programming defect.
- try-catch-finally
- Related: checked exception, throws clause
The structure used for exception handling: try surrounds risky code, catch handles a matching thrown type, and finally executes regardless, typically for cleanup work.
- throws clause
- Related: checked exception
Part of a method declaration that lists the checked exceptions the method may pass on to its caller instead of handling them internally.
- ArrayList
- Related: array, wrapper class
A resizable, index-ordered collection from java.util. Its size grows and shrinks automatically, and elements are read with get and inserted with add.
- StringBuilder
- Related: String immutability
A mutable sequence of characters used to assemble text with repeated appends without creating a new object each time, unlike a String.
- equals method
- Related: reference equality (==), String immutability
The method used to compare two objects for logical equality, commonly overridden to check contents. String overrides it to compare characters, which is why it differs from ==.
- String immutability
- Related: StringBuilder, equals method
The rule that a String's characters never change after the object is created. Operations such as trim or replace return a new String and leave the original untouched.