Why am I getting ClassCastException when I instantiate a class and casting it to that interface which is being implemented by this class?
<p>I am new to this <code>ClassLoader</code> concept. I wasted almost a week for this but I couldn't find any solution.</p>

<pre><code>URLClassLoader jarLoader = new URLClassLoader (urlList);
Class clazz = jarLoader.loadClass(classname);
Object instance=clazz.newInstance();
(Interface1)(instance);
</code></pre>

<p>Here, in line 4, I'm getting <code>ClassCastException</code>.</p>

<p>Please help me resolve this? I would appreciate for any feedback.</p>
