| Author |
ClassCastException
|
Rahul Saple
Ranch Hand
Joined: Aug 02, 2006
Posts: 46
|
|
Ok here's the scene ........ i've gotta function which i need to call whose signature goes like this and is inside a class named AdvertisementFactory. now ive got a class called CodatAdv which has got a public static Inner class named Instantiator which implements the original AdvertisementFactory.Instantiator and has all the methods of that particular interface(AdvertisementFactory.Instantiator) But when i call the above static method with the following parameters i get a classcastexception at runtime....... can someone out here tell me where i'm going wrong coz as far as i know a super-interface can always point to a sub-interface of the same class.
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
I had some trouble following you, but as far as I can tell, you're describing something like this (with a few names shortened)... This compiles and runs fine for me.
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
Is that really a beginner's question? Whenever you get an Exception you need to look at its stack trace, and find out where it occurred. That should give you a hint what to do to sort it out.
|
 |
 |
|
|
subject: ClassCastException
|
|
|