Hi Debasis,
[CODE=java]class Loader1 extends ClassLoader{
public Class findClass(Strin g name) throws ClassNotFoundEx ception{
System.out.prin tln("in findClass");
byte[] b=null;
try{
b = loadClassData(n ame);
}catch(Exceptio n e){
}
Class c=defineClass(" javaexp.PrimeNu mber",b,0,b.len gth);
// resolveClass(c) ;
...
User Profile
Collapse
-
class cast exception when I tried to covert the class object to specific one
Hi,
In my custom classloader i read the bytes using fileinputstream and constructed a class object using define class method.
then
I have used newInstance method on that loaded class object.
But casting to the specific Object is failing with class cast exception
can any one let me know the reason
regards
shanawaz
No activity results to display
Show More
Leave a comment: