I want to print all the class names in a package, and also print the corresponding attributes and their data types in each package.
In one code, I can get the class names as a string. In another code, I can get the attributes and their data types using Classname.class.getAttribute();
However, I want to combine the two codes. Since in the first code I got the class names as a string, I can not use Classname.class.getAttribute() , since here Classname will be of type String .
So, I need a method that converts a class name from a String type to a Class type.
I tried Class.forName() , but that did not work.
Bipin wanchoo
source share