This content has been marked as final. Show 6 replies
847747 wrote:<head-desk /> Why not add them before start?
To add classes on runtime and use their methods.
Or to put your answer in a way that is more clear to me, express it as you might express it as a 'feature' on the shrink-wrapped packaging. E.G.
This product is:
<li>Whiter, brighter, with extra bubbles.
<li>30% faster than major competitors
<li>Your feature here
Edited by: Andrew Thompson on Mar 28, 2011 10:41 AM
847747 wrote:I believe you need ClassLoader.loadclass(), but most of them are tied in to the classpath. [url http://www.exampledepot.com/egs/java.lang/LoadClass.html]This page shows an example of loading a class that is not in the classpath using a URLClassLoader, but I don't know if it works or any 'gotchas' that might be associated with the technique, because (a) I've never had any reason to do it, and (b) I've never had the urge to try ;-).
So the question is:
How do i get from the path of a file to the class name which i can use to load the class that is represented by the file?
YoungWinston wrote:Certainly one can load them via that class. Whether that example is correct I don't know.
... shows an example of loading a class that is not in the classpath using a URLClassLoader, but I don't know if it works
or any 'gotchas' that might be associated with the technique,Normal problems are
1. Attempting to use the same class that is to be loaded in the main app.
2. Problems with unloading.