Is it possible to load a class by name if you don’t know the whole package path? Something like:
getClassLoader().loadClass("Foo");
The class named “Foo” might be around, might not be – I don’t know the package. I’d like to get a listing of matching classes and their packages (but not sure that’s possible!),
Thanks
Nope. The Java
ClassLoader.loadClass(String)method requires that class names must be fully qualified by their package and class name (aka “Binary name” in the Java Language Specification).