0

I'm not really sure how to describe this so i'll try my best:

Say i have 2 classes, one called Ping(a listener class which waits for certain inputs) and the other Pong. in the Ping class i have a Pong object saved like so: public static Pong pong = new Pong().

Now while the main method is running in the Ping class, i edited the code in the Pong class, and now i want to update my Pong object with the new code, the problem is, if i'll just do: pong = new Pong() this will create an object identical to my previous one. so what i wanna know is, how i can recompile the Pong class and create a new Pong object in the Ping class that has the updated code, without stopping the main program?

I hope i was clear enough with my question, any help/advice is appreciated.

user619361
  • 33
  • 1
  • 3
  • 1
    http://stackoverflow.com/questions/1064259/how-can-i-compile-and-deploy-a-java-class-at-runtime – jgitter Nov 29 '16 at 15:15
  • I suspect this is actually about hotswapping code. You can do that in most IDEs when using the debug mode. – Kayaman Nov 29 '16 at 15:15

0 Answers0