Java TypeVariable.getBounds()

Syntax

TypeVariable.getBounds() has the following syntax.

Type [] getBounds()

Example

In the following code shows how to use TypeVariable.getBounds() method.


import java.lang.reflect.TypeVariable;
import java.util.List;
/*  ww  w  .  ja va 2  s.c o m*/
public class Main {
  public static void main(String args[]) throws Exception {

    TypeVariable[] tv = List.class.getTypeParameters();
    System.out.println(tv[0].getBounds().length); 

  }
}




















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable