Question
Which statement about Generics and Wildcards is the strongest interview answer?
- Generics and Wildcards is mostly a naming style choice and has little effect on runtime or design.
- Generics add compile-time type safety and reduce unsafe casting.
- Generics and Wildcards exists mainly to reduce the number of Java files in a project.
- Generics and Wildcards matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind Generics and Wildcards.
Answer and rationale
Correct answer: B. Generics add compile-time type safety and reduce unsafe casting.
Generics add compile-time type safety and reduce unsafe casting. This is the base concept interviewers commonly test first.
Track: Java