Question: How would you go about establishing where a class ( or maybe resource ) has been loaded from?

I am trying to work out exactly where a class has been loaded from. Does anyone know if you can find out the following:

1. Which Jar file did the class come from ?
2. What classloader loaded the file?

Answer: 
You can get an URL by calling MyClass.class.getResource("MyClass.class") for instance.
if you have an instance of the class
insta.getClass().getClassLoader().getName() -->this is the classloader that loaded the class

insta.getClass().getProtectionDomain().getCodeSource().getLocation()- where the class was loader from