Type类型

Type类型

Type是接口,它的实现类(子接口)有Class, ParameterizedType, WildcardType, TypeVariable, GenericArrayType

  • All Known Subinterfaces:

    • GenericArrayType,
      GenericArrayType represents an array type whose component type is either a parameterized type or a type variable.
    • ParameterizedType,

    ParameterizedType represents a parameterized type such as Collection.
    A parameterized type is created the first time it is needed by a reflective method, as specified in this package. When a parameterized type p is created, the generic type declaration that p instantiates is resolved, and all type arguments of p are created recursively. See TypeVariable for details on the creation process for type variables. Repeated creation of a parameterized type has no effect.
    Instances of classes that implement this interface must implement an equals() method that equates any two instances that share the same generic type declaration and have equal type parameters.

    • TypeVariable,

    D - the type of generic declaration that declared the underlying type variable.
    TypeVariable is the common superinterface for type variables of kinds. A type variable is created the first time it is needed by a reflective method, as specified in this package. If a type variable t is referenced by a type (i.e, class, interface or annotation type) T, and T is declared by the nth enclosing class of T (see JLS 8.1.2), then the creation of t requires the resolution (see JVMS 5) of the ith enclosing class of T, for i = 0 to n, inclusive. Creating a type variable must not cause the creation of its bounds. Repeated creation of a type variable has no effect.
    Multiple objects may be instantiated at run-time to represent a given type variable. Even though a type variable is created only once, this does not imply any requirement to cache instances representing the type variable. However, all instances representing a type variable must be equal() to each other. As a consequence, users of type variables must not rely on the identity of instances of classes implementing this interface.

    • WildcardType(如List)
  • All Known Implementing Classes:

    • Class

你可能感兴趣的:(Type类型)