lundi 3 août 2015

How to get an inner class in Java Reflection? [duplicate]

This question already has an answer here:

I have the following class:

package me.victor.test;

public class ContainerClass {

    public class InnerClass {
        // ...
    }
}

How can I get the Class type of the InnerClass using reflection?

Using: Class.forName("me.victor.test.ContainerClass.InnerClass"); throws a ClassNotFoundException.





Aucun commentaire:

Enregistrer un commentaire