How to create instance of class File?
问题 I've taken a class file(say Foo.class ) using JFileChooser and stored it in a File class object(say File a ). now I've to read metadata like methods and variables of this Foo.class using reflection APIs. My question is that, I've stored it in a , which is just a File reference variable . So how can I use any API on a File. or any other suggestion for doing so are also welcomed. 回答1: as i understand,first of all you need to convert class file to Class object you can do that via UrlClassLoader