Core Java
The Java language itself: types, loops, records, enums, exceptions and java.time.
Take this course in the learning hubLessons
- Variables and typesDeclare values with the right type, and know why 0.1 + 0.2 is not 0.3.
- Operators and expressionsUse arithmetic, comparison and logical operators without falling into the classic traps.
- Control flowBranch with if, repeat with the four loop forms, and pick the right one each time.
- Methods and varargsWrite methods, overload them safely, and understand what Java actually passes to them.
- ArraysCreate, index and sort fixed-size arrays, and know when to reach for a List instead.
- Strings, StringBuilder, text blocksCompare strings correctly, build them efficiently, and write multi-line text without escapes.
- Wrapper classes and autoboxingMove between int and Integer on purpose, and avoid the null and == surprises.
- static vs instance membersTell class-level state apart from per-object state and choose the right one.
- Packages and importsOrganise classes into packages and bring other packages into scope.
- Switch expressionsReturn a value from switch with arrow labels, no break statements and no fall-through.
- RecordsDeclare immutable data carriers in one line, with equals, hashCode and toString included.
- EnumsReplace magic strings with a fixed, compiler-checked set of constants that can carry data.
- ExceptionsThrow, catch and wrap errors so failures stay visible instead of disappearing.
- try-with-resourcesClose files, streams and connections automatically, even when the block throws.
- Optional basicsModel a possibly-missing value in the type system instead of returning null.
- Dates and times with java.timePick the right date-time type, do calendar maths safely, and handle time zones.
- The main method and argsLearn the entry point the JVM looks for, and read the arguments it hands you.
- Comments and JavadocWrite the three comment forms, and document an API the way the tooling expects.
- Naming conventionsUse the names the whole ecosystem expects, so your code reads like the standard library.
- The ternary operatorChoose between two values in a single expression, and know when it hurts readability.
- Casting and type conversionWiden for free, narrow on purpose, and tell a primitive cast from a reference cast.
- char arithmeticTreat char as the number it really is, for letter maths, digits and simple ciphers.
- Math utilitiesUse java.lang.Math instead of hand-rolling rounding, powers and safe arithmetic.
- Bitwise operators and flagsSet, clear, test and shift bits — the idiom behind permission flags and fast maths.
- Labelled break and continueEscape nested loops in one jump instead of juggling a found flag.
- String formattingBuild readable text with printf-style patterns instead of long chains of plus signs.
- StringBuilder capacitySee why appending is cheap, when the buffer is copied, and how to avoid the copy.
- Reading input with ScannerRead text and numbers from a source, and dodge the classic nextInt/nextLine trap.
- Generic classes and methodsWrite your own generic type, bound it, and see what the compiler erases before runtime.
- Pattern matching for switchSwitch on the type of a value, destructure a record, and narrow a case with when.
- Recursion and the call stackSolve a problem by calling the method again, and know exactly what each call costs.
- Regular expressionsMatch, split and replace text with java.util.regex instead of hand-rolling a parser.
- BigDecimal and moneySee why double loses cents, and hold money in BigDecimal or in whole cents instead.
- AnnotationsUse the built-in annotations, declare your own, and see which ones reach the runtime.
- Files and PathsBuild file names with Path, then read them with the modern java.nio.file API.
- Functional interfacesMatch a lambda to the right java.util.function type instead of inventing your own.
- Scope, shadowing and finalKnow where a name is visible, when it dies, and what effectively final really means.
- How finally can silently change your answerA return in finally discards the real result - including an exception.
- Floating point: NaN, negative zero and equalityValues that are not equal to themselves, and why BigDecimal has two comparisons.
- When a class is actually initialisedConstants inline at compile time, and a static cycle yields a null you can observe.
- Varargs, ambiguity and heap pollutionA convenience that hides an array, and generics make it unsafe.
- String identity, interning and concatenationWhy == sometimes works on strings, which is worse than never working.