Generics Flashcards
1
Q
What are Generics in java?
A
It is a feature that allows us pass TYPES to methods, classes and interfaces.
2
Q
What are the beneficts of generics?
A
1 - Remove the need for casting
2 - Get safer code with errors being spoted in compile time instead of runtime.
3
Q
How is called the type passed between the diamonds?
A
Parametarized Type
4
Q
What are Bounded Types?
A
Bounded types are used when we want to restrict which types may be passed to an interface, class or method