Skip to Content
Java in a Nutshell, 5th Edition
book

Java in a Nutshell, 5th Edition

by David Flanagan
March 2005
Intermediate to advanced
1254 pages
104h 21m
English
O'Reilly Media, Inc.
Content preview from Java in a Nutshell, 5th Edition

Name

TypeVariable<D extends GenericDeclaration>

Synopsis

This interface extends Type and represents the generic type represented by a type variable. getName( ) returns the name of the type variable, as it was declared in Java source code. getBounds( ) returns an array of Type objects that serve as the upper bounds for the variable. The returned array is never empty: if the type variable has no bounds declared, the single element of the array is Object.class. The getGenericDeclaration( ) method returns the Class, Method, or Constructor that declared this type variable (each of these classes implements the GenericDeclaration interface). Note that TypeVariable is itself a generic type and is parameterized with the kind of GenericDeclaration that declared the variable.

java.lang.reflect.TypeVariable<D extends GenericDeclaration>

Figure 10-102. java.lang.reflect.TypeVariable<D extends GenericDeclaration>

public interface TypeVariable<D extends GenericDeclaration> extends Type {
// Public Instance Methods
     Type[ ] getBounds( );  
     D getGenericDeclaration( );  
     String getName( );  
}

Returned By

Class.getTypeParameters( ), Constructor.getTypeParameters( ), GenericDeclaration.getTypeParameters( ), Method.getTypeParameters( )

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan
Java in a Nutshell, 7th Edition

Java in a Nutshell, 7th Edition

Benjamin J. Evans, David Flanagan
Learning Java, 5th Edition

Learning Java, 5th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck
Learning Java, 4th Edition

Learning Java, 4th Edition

Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 0596007736Supplemental ContentErrata Page