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.