Oracle Java Foundations study materials
Oracle Java Foundations study resources

Oracle Java Foundations key terms

Oracle Java Foundations · Get comfortable with the vocabulary.

JDK

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.

Related: JVM, bytecode
JVM

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.

Related: JDK, bytecode
bytecode

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.

Related: JVM, JDK
main method

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.

Related: static member
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

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.

Related: reference type, autoboxing
reference type

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.

Related: primitive type, casting
autoboxing

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.

Related: wrapper class, primitive type
wrapper class

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.

Related: autoboxing
casting

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.

Related: reference type
operator precedence

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.

Related: short-circuit evaluation
short-circuit evaluation

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.

Related: operator precedence
switch statement

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.

Related: break / continue
reference equality (==)

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.

Related: equals method
array

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.

Related: enhanced for loop
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.

Related: while loop, enhanced for loop
enhanced for loop

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.

Related: for loop, array
while 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.

Related: do-while loop, for loop
do-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.

Related: while loop
break / continue

Loop and switch control keywords: break leaves the innermost loop or switch immediately, while continue abandons the current pass and begins the next iteration.

Related: for loop, switch statement
method signature

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.

Related: method overloading
method overloading

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.

Related: method signature, method overriding
access modifier

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.

Related: encapsulation
encapsulation

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.

Related: access modifier
constructor

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.

Related: this keyword
this keyword

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.

Related: constructor
static member

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.

Related: main method
extends / inheritance

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.

Related: method overriding, polymorphism
method overriding

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.

Related: polymorphism, method overloading
polymorphism

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.

Related: method overriding, abstract class
abstract class

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.

Related: interface, polymorphism
interface

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.

Related: abstract class
checked exception

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.

Related: unchecked exception, throws clause
unchecked 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.

Related: checked exception
try-catch-finally

The structure used for exception handling: try surrounds risky code, catch handles a matching thrown type, and finally executes regardless, typically for cleanup work.

Related: checked exception, throws clause
throws clause

Part of a method declaration that lists the checked exceptions the method may pass on to its caller instead of handling them internally.

Related: checked exception
ArrayList

A resizable, index-ordered collection from java.util. Its size grows and shrinks automatically, and elements are read with get and inserted with add.

Related: array, wrapper class
StringBuilder

A mutable sequence of characters used to assemble text with repeated appends without creating a new object each time, unlike a String.

Related: String immutability
equals method

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 ==.

Related: reference equality (==), String immutability
String immutability

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.

Related: StringBuilder, equals method