title: Java example with ClassLoader
body: <p>I have small problem. I learn java SE and find class ClassLoader. I try to use it in below code:
  I am trying to use URLClassLoader to dynamically load a class at runtime.</p>
  
  <pre><code>URLClassLoader urlcl = new URLClassLoader(new URL[] {new URL("file:///I:/Studia/PW/Sem6/_repozytorium/workspace/Test/testJavaLoader.jar")});
  Class&lt;?&gt; classS = urlcl.loadClass("michal.collection.Stack");
  for(Method field: classS.getMethods()) {
       System.out.println(field.getName());
  }
  Object object = classS.newInstance();
  michal.collection.Stack new_name = (michal.collection.Stack) object;
  </code></pre>
  
  <p>The java virtual machine does not see me class, and I get the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problems: michal cannot be resolved to a type michal cannot be resolved to a type at Main.main(Main.java:62)
  </code></pre>
  
  <p><strong>Do you know how I can solve this problem?</strong></p>