The code you posted does exactly what your original question asked - gets the Class object from a File object. Perhaps I am misunderstanding - what you actually trying to do?
Type: Posts; User: copeg
The code you posted does exactly what your original question asked - gets the Class object from a File object. Perhaps I am misunderstanding - what you actually trying to do?
Every Object in java has a getClass() method that returns the Class instance of the class. You could also use the class keyword (eg File.class )