I\'m playing around with Reflection and I thought I\'d make something which loads a class and prints the names of all fields in the class. I\'ve made a small hello world typ
From the Javadocs for the URLClassLoader(URL[]) constructor:
Constructs a new URLClassLoader for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be downloaded and opened as needed.
So you have two options:
(1) is easier in this case, but (2) can be handy if you're using networked resources.