O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Generics

Jose Juan Ramírez Espanhol

Conteúdo do mapa

Generics

  1. Generics

    • Type parameter: placeholder for a type declared in a generic
    • Type argument: actual type used to parametrize a generic
  2. Generic Constrainst

    • Type parameter bound: limit possible values of type argument. We need to explicity define a type parameter upper bound
    • Nullabilty: non-nullable and nulable types as type argument. We need to explicity define a non-nullable type explicity
  3. Variance

    • Modifiers
      • Covariant: subtyping is preserved
        • out
      • Contravarient: reversed
        • in
      • Invariant: ignored. Default
    • Place in the code
      • use-site
      • declaration-site
    • Collection
      • Invariant by default
      • List: co-variant
      • MutableList: invariant
    • Limitation: only limited to a single position
      • in: method parameters
      • out: method return value
    • Constructor
      • parameters are always invariant
  4. Type erasure

    • Process of removing a type argument from a generic type
      • JvmName to change the name of one of the methods
    • Reified
      • special modier that can preserve a type-argument at runtime
      • only with inline functions
  5. Star-projections

    • way to say that information about type argument is missing or it is not important
  6. programming style where classes, fuctions, data structures or algorithms are written in such way that the exact type can be specified late

Informações

Descrição
Mapa Mental sobre Generics, criado por Jose Juan Ramírez em 12-01-2018.
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?