Java Generics, Type Erasure, Wildcards & Covariance/Contravariance
Master generic classes, generic methods, compile-time Type Erasure mechanics, wildcards (`?`), bounded wildcards (`? extends T` vs `? super T`), and PECS principle.
Type Erasure & The PECS Principle
### The PECS Rule (Producer Extends, Consumer Super)
- **Producer Extends (`? extends T`)**: Use when your generic parameter ONLY provides data (read-only).
- **Consumer Super (`? super T`)**: Use when your generic parameter ONLY consumes data (write-only).
- **Type Erasure**: Java compiler removes all generic type information during compilation, replacing parameters with Object or bound types for backward compatibility with pre-Java 5 bytecodes!