Generics Flashcards Preview

Java > Generics > Flashcards

Flashcards in Generics Deck (4)
Loading flashcards...
1

What are Generics in java?

It is a feature that allows us pass TYPES to methods, classes and interfaces.

2

What are the beneficts of generics?

1 - Remove the need for casting
2 - Get safer code with errors being spoted in compile time instead of runtime.

3

How is called the type passed between the diamonds?

Parametarized Type

4

What are Bounded Types?

Bounded types are used when we want to restrict which types may be passed to an interface, class or method