mercredi 22 juin 2016

Is it possible to get List of Classes in a package for Reflection

i wrote code to get the list of methods in a class as following

Code

package checking;

import java.lang.reflect.Method;

public class Test {

    public static void main(String[] args) {
        Class<CrossBrowserScript> obj = CrossBrowserScript.class;
        Method[] meth = obj.getMethods();
        for (Method method : meth) {
            String Mname = method.getName();
            System.out.println(Mname);
        }
    }
}

But i want to get the List of class names in a package using reflection.





Aucun commentaire:

Enregistrer un commentaire