开发者

How can I run java code that has been pasted into my program

I'm making a simulator for Time Complexity. The purpose is that Students can choose which algorithms they want to compare.

But I want to make it possible to compare algorithms they've written themselves. I know how to get it to work with a compiled .class file.

I was wondering whether it is possible for the students to just paste the code (with predefined public methods) and then just run it.

I suppose that I have to do something with javac开发者_运维知识库.

Any ideas are welcome!

Thanks


Use the JavaCompiler class. You will need to add tools.jar to your classpath if you don't already have it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜