Generics
How Java generics provide compile-time type safety through parameterised types — covering generic classes, generic methods, bounded type parameters, and the key constraint that generics only work with reference types.
How Java generics provide compile-time type safety through parameterised types — covering generic classes, generic methods, bounded type parameters, and the key constraint that generics only work with reference types.
Consolidated interview Q&A for the Java Type System — primitives, autoboxing, generics, wildcards, type erasure, and type inference.
How the Java compiler removes all generic type information before producing bytecode, why this design choice was made for backward compatibility, and what limitations it imposes at runtime.
How the Java compiler deduces types automatically — covering the diamond operator, generic method type inference, `var` (Java 10+), and lambda target typing — and where inference has limits.
How Java's wildcard type arguments — `?`, `? extends T`, and `? super T` — express variance in generic APIs, and how the PECS rule guides correct usage.
Java's eight primitive wrapper types — Integer, Long, Double, and friends — covering autoboxing, caching traps, parsing, and when to use primitives vs objects.