Dynamically interpreting/importing code/classes
I wish to make a program that is capable of importing classes that have not been included or referenced in the program itself.
I would also like to know if Java offers some way to interpret code from say, an input text box or a file, for on-the-fly execution, either in plain text or bytecode form.
With proper interpretation I mean to even declare completely new variables, etc., at run time.
I want to make a program that allows the user to specify a list of Java commands and the program loads the code and/or classes on demand, to test any APIs easily and to test different exceptions and results, etc.
Please point me to the most appropriate API references to do this, and a simple example or rationales if you consider it necessary.