Package net.jrodolfo.java_evolution.java05
package net.jrodolfo.java_evolution.java05
Examples for features introduced in Java 5.
Java 5 was a major language and library release. It introduced generics,
including bounded wildcards and multiple bounds, enhanced for loops,
autoboxing, enums, varargs, static imports, annotations, covariant return
types, formatted output, and the java.util.concurrent utilities.
The classes in this package use only syntax that remains valid on the repository's JDK 26 baseline, while explaining the Java 5 origin of each feature.
-
ClassDescriptionDemonstrates annotations, introduced in Java 5.Runtime-retained marker used by the example.Demonstrates autoboxing and unboxing, introduced in Java 5.Demonstrates
java.util.concurrent, introduced in Java 5.Demonstrates covariant return types, introduced in Java 5.Demonstrates the enhancedforloop introduced in Java 5.Minimal custom iterable used by the enhanced-for examples.Demonstrates Java 5 typesafe enums.Real enum values can carry fields and methods while remaining a closed set of constants.Demonstrates formatted output APIs introduced in Java 5.Demonstrates generics, introduced in Java 5.Language-level feature used by the wildcard example.First capability required by the multiple-bound example.Platform-level feature used by the wildcard example.Second capability required by the multiple-bound example.Concrete type that satisfies both bounds.Base type for the bounded wildcard example.Demonstrates static import, introduced in Java 5.Demonstrates varargs, introduced in Java 5.