In Robocode, which is a robotics battle simulator, the user can program a robot using
java, and then use it in a battle. The robot must extends Robot class, and the user can select to use it for a battle in the robocode program.
How do they do this? because in order to use the robot, the code would have to reference it in it's own code. But the Robocode program is already compiled, it can't change the source code of itself... and yet if you write a class that extends robot you can use it in the program as if the Robocode program has a reference to it in itself... I don't know how to describe this in one or two words... but hopefully you know what I mean.
I want to do something similar with my program, where the user can program something and use it in my program.