There comes a time we are forced to use multiple version of a library in the project. The Java system classloader will load a specific class only once. To load different implementation of a class reside in different versions of JAR file, we can make use of java.net.URLClassLoader.
Following is an example code of using URLClassLoader to load the class named HelloPrint from two different versions of Hello library.
The ClassloaderMultipleVersion.java
This example make use of Java Reflection to invoke the method.