I have a situation where i need to cast java objects dynamically .
I agree with Ilja that this is something that you do not want or need to do.
- You write the source code before you compile or run the program.
- You say that you don't know what you want to cast the variable to before runtime.
Those two are in conflict with eachother. At the moment you write the source code, you already know to what type of variable you are assigning the result of the cast expression to - you already know it at compile time, not at runtime.
So you must be confusing some things.
Can you explain why you think you need to do this?
[ July 18, 2006: Message edited by: Jesper Young ]