Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I need help with custom ClassLoader's  RSS feed

Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay here is my problem. Imagine a program that is similar to a web browser. Instead of this program loading webpages it loads class files and shows them. Now imagine this class file changing while its still loaded into the browser, so it needs to be reloaded. But the problem is that the class which is already loaded gets instantiated again and the new class never gets loaded. Here is some very basic code to describe my problem.
If you wanna help me out, run this program and then press the load class button. Now open the source code of the and change the System.out.println() line to display something else and recompile that file. Now go back to the program that should still be running and hit load class again. What happens is that the new class isn't loaded, you get the cached memory copy of the old one. Can somebody help me figure out how to load the new class in from disk please. Thank you!

Thanks In Advance,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!