There is no problem to load class without package name. Check my example (Class "Test" must has no package):
public class Test {
public static void main(String[] args) {
try {
Class<?> myClass = Test.class.getClassLoader().loadClass("Test");
System.out.println(myClass);
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
You will got console output without exception:
class Test