Core Java
The language itself — compilation, types, strings, methods, packages, modifiers, enums, records, annotations and nested classes. JDK/JRE/JVM, Java basics and exception handling have their own pages earlier in this subject.
This is an overview — pick a sub-topic below.
Sub-topics (21)
Java Compilation and Bytecode
`javac` compiles `.java` source into platform-independent `.class` bytecode that the JVM runs.
Variables in Java
Typed named storage: local, instance (fields) and static (class) variables.
Primitive Types
Eight built-in value types: `byte`, `short`, `int`, `long`, `float`, `double`, `char`, `boolean`.
Reference Types
Variables of class, interface and array types hold references to objects on the heap.
Operators in Java
Arithmetic, relational, logical, bitwise, shift (`>>`, `>>>`), assignment, ternary and `instanceof`.
Control Flow in Java
`if`/`else`, `switch`, `for`, enhanced `for`, `while`, `do-while`, `break`, `continue`.
Arrays in Java
Fixed-size, typed, zero-indexed objects with a `length` field and bounds checking.
Strings in Java
Immutable sequences of characters with many methods.
StringBuilder
A mutable string buffer for efficient concatenation in loops.
Methods
Functions defined in classes: return type, name, parameters, body.
Varargs
Accept a variable number of arguments as an array.
Packages
Namespaces that organise classes, matching the folder structure.
Imports
Bring classes from other packages into scope.
Access Modifiers
Control visibility: `public`, `protected`, package-private (no keyword) and `private`.
Static Members in Java
Fields and methods belonging to the class rather than an instance.
Enums in Java
Type-safe sets of constants that can have fields, constructors and methods.
Records
Concise immutable data classes (Java 16+) with constructor, accessors, `equals`, `hashCode` and `toString` generated.
Annotations
Metadata on code: `@Override`, `@Deprecated`, `@FunctionalInterface`, and framework annotations like `@Test` or `@GetMapping`.
Nested Classes
Classes declared inside another class; static nested classes don't need an outer instance.
Inner Classes
Non-static nested, local and anonymous classes that can access the outer instance.
Assertions
`assert condition : "message";` checks assumptions during development.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.