User Profile

Collapse

Profile Sidebar

Collapse
shanu
shanu
Last Activity: Jan 23 '08, 08:34 AM
Joined: Jan 22 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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) ;
    ...
    See more | Go to post
    Last edited by RedSon; Jan 23 '08, 04:51 PM. Reason: CODE

    Leave a comment:


  • 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
    See more | Go to post
No activity results to display
Show More
Working...