Reflection is used to load java class classes and manipulate them on the fly. But I have across a weird question that is asking me how to create Java classes on the fly by R
Seems to me you don't need reflection, but just need to call the JavaCompiler directly from your code: JavaCompiler.