Get the fully-qualified name of a inner class in Java

Description

The following code shows how to get the fully-qualified name of a inner class.

Example


// w w w  .j  av a  2  s  .  c o m
public class Main {
  public static void main(String[] argv) throws Exception {

    Class cls = java.util.Map.Entry.class;
    String name = cls.getName(); 
    System.out.println(name);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Reflection »




Annotation
Array
Class
Constructor
Field
Generics
Interface
Method
Modifier
Package
Proxy