Question 1: JAVA - Generics Basics
What is the main purpose of Generics in Java?
Question 2: JAVA - Generic Class
Which of the following correctly defines a generic class?
Question 3: JAVA - Generic Method
Which syntax is correct for a generic method?
Question 4: JAVA - Type Safety Example
What will happen in this code?
Question 5: JAVA - Wildcard ?
What does the wildcard ? represent in generics?
Question 6: JAVA - Upper Bounded Wildcard
Which declaration is correct for a list of numbers (Integer, Double, etc.)?
Question 7: JAVA - Lower Bounded Wildcard
Which syntax is used for a generic type that can accept Integer or its supertypes?
Question 8: JAVA - Generic Example Code
What will this code print?
Question 9: JAVA - Type Erasure
How does Java implement generics internally?
Question 10: JAVA - Multiple Type Parameters
Which of the following correctly declares a generic class with two type parameters?