Generics Flashcards

1
Q
  • Describe the use of Generics functions in Java*
  • Describe bounded types parameters*
  • Describe the use of Generics classes in Java*
A

Functions:

  • The generic ‘<e> should be declared right before the return value of the function</e>
  • Generic types can represent only reference types, not primitive types.

Bounded types

  • Declare the type Parameter <t> followed by the extend word, followed by the upper bound:</t>
    • ​<t>&gt;</t>

Generic class

  • We can define several generic types
  • <t> follows the name of the class</t>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly