What do you mean exactly by "creating a class definition at runtime", can you explain your question in more detail?
There are libraries that can help you to programmatically create class files and byte code, for example Apache BCEL (which stands for Byte Code Engineering Library). But this is very advanced and something that's only necessary for very specialistic applications. It's certainly not something that belongs in the "Beginning Java" forum...
Well as Jesper said there are libraries for java to create the class files. Well i suppose when i had studied Programming with Components i.e COM there was something similar to that which created some files based on the signatures, but i think that is not at runtime. Its still during compiling, the class files are created after a successful compilation. May be i have forgot many things on that as it was some couple of years back. Just clarify on this please.
[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad: