Casting of object for a class loaded at runtime

Posted by Steven on Stack Overflow See other posts from Stack Overflow or by Steven
Published on 2010-03-31T05:25:23Z Indexed on 2010/03/31 5:33 UTC
Read the original article Hit count: 272

Filed under:
|

hi, i load a class using

Class.forName(klassname,false,loader)

After this i create an instance using

klass.newInstance(); It returns an object type.I want to cast it to specific type(ie.Klassnamw instance).I used normal casting but it gets hung because it is not resolved during runtime.How can i cast it?Hellp

© Stack Overflow or respective owner

Related posts about reflection

Related posts about java