Get class name for double and float array in Java

Description

The following code shows how to get class name for double and float array.

Example


/*from   www. j  a  va2  s.com*/
public class Main {
  public static void main(String[] args) {
    Class c = String.class;
    System.out.println(c.getName());

    c = Main.class;
    System.out.println(c.getName());

    c = double.class;
    System.out.println(c.getName());

    c = float[].class;
    System.out.println(c.getName());
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Reflection »




Annotation
Array
Class
Constructor
Field
Generics
Interface
Method
Modifier
Package
Proxy