Skip to main content

Uncategorized

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.