Skip to main content

Java 11 Features with Examples (and What Changed from Java 8)

What Java 11 added over Java 8, with runnable examples and real output from JDK 8 and JDK 11: var in lambdas, the new String methods, Files.readString, the standard HttpClient, single-file launch, nest-based access, and the Java EE and CORBA modules that were removed.

Access Modifiers in Java: public, protected, default and private Explained

Access modifiers in Java with a visibility matrix: public, protected, default (package-private) and private, the protected-across-packages trap with real compiler errors, which modifiers apply to classes vs members, and how JPMS modules add a layer above public. Verified on JDK 25.

final vs finally vs finalize in Java: Differences with Examples

final vs finally vs finalize in Java: a comparison table, final variables, methods and classes, the finally edge cases (return in finally, System.exit), and what finalize() does on JDK 25 and what to use instead. Verified with real output.