Re: Casting from a class that was passed as a string.
Posted By:
Bozidar_Dangubic
Posted On:
Wednesday, February 13, 2002 07:14 AM
what do you mean you do not know which Class MyClass is??? it is package.MyClass Class. you created it using Class.forName("package.MyClass").newInstance(); so myObject is package.MyClass. so if you want to execute a method that is in package.MyClass use ((package.MyClass)myObject).someMethodOfMyClass();