Stay organized with collections
Save and categorize content based on your preferences.
Type
public
interface
Type
Known indirect subclasses
Class<T> |
Instances of the class Class represent classes and
interfaces in a running Java application.
|
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<String>.
|
TypeVariable<D extends GenericDeclaration> |
TypeVariable is the common superinterface for type variables of kinds.
|
WildcardType |
WildcardType represents a wildcard type expression, such as
? , ? extends Number , or ? super Integer .
|
|
Type is the common superinterface for all types in the Java
programming language. These include raw types, parameterized types,
array types, type variables and primitive types.
Summary
Public methods |
default
String
|
getTypeName()
Returns a string describing this type, including information
about any type parameters.
|
Public methods
getTypeName
public String getTypeName ()
Returns a string describing this type, including information
about any type parameters.
Implementation Requirements:
- The default implementation calls
toString
.
Returns |
String |
a string describing this type |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Type\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nType\n====\n\n\n`\npublic\n\n\ninterface\nType\n`\n\n\n`\n\n\n`\n\n|------------------------|\n| java.lang.reflect.Type |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [Class](/reference/java/lang/Class)\\\u003cT\\\u003e, [GenericArrayType](/reference/java/lang/reflect/GenericArrayType), [ParameterizedType](/reference/java/lang/reflect/ParameterizedType), [TypeVariable](/reference/java/lang/reflect/TypeVariable)\\\u003cD extends [GenericDeclaration](/reference/java/lang/reflect/GenericDeclaration)\\\u003e, [WildcardType](/reference/java/lang/reflect/WildcardType) |----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------| | [Class](/reference/java/lang/Class)\\\u003cT\\\u003e | Instances of the class `Class` represent classes and interfaces in a running Java application. | | [GenericArrayType](/reference/java/lang/reflect/GenericArrayType) | `GenericArrayType` represents an array type whose component type is either a parameterized type or a type variable. | | [ParameterizedType](/reference/java/lang/reflect/ParameterizedType) | ParameterizedType represents a parameterized type such as Collection\\\u003cString\\\u003e. | | [TypeVariable](/reference/java/lang/reflect/TypeVariable)\\\u003cD extends [GenericDeclaration](/reference/java/lang/reflect/GenericDeclaration)\\\u003e | TypeVariable is the common superinterface for type variables of kinds. | | [WildcardType](/reference/java/lang/reflect/WildcardType) | WildcardType represents a wildcard type expression, such as `?`, `? extends Number`, or `? super Integer`. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nType is the common superinterface for all types in the Java\nprogramming language. These include raw types, parameterized types,\narray types, type variables and primitive types.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default `[String](/reference/java/lang/String) | ` `[getTypeName](/reference/java/lang/reflect/Type#getTypeName())`() ` Returns a string describing this type, including information about any type parameters. |\n\nPublic methods\n--------------\n\n### getTypeName\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic String getTypeName ()\n```\n\nReturns a string describing this type, including information\nabout any type parameters.\n\n\u003cbr /\u003e\n\n##### Implementation Requirements:\n\n- The default implementation calls `toString`.\n\n| Returns ||\n|---------------------------------------|--------------------------------------|\n| [String](/reference/java/lang/String) | a string describing this type \u003cbr /\u003e |"]]