z****g 发帖数: 2497 | 1 I got a very weird exception
code:
...
//isotopes is a Vector
cdk.Isotope iso = (cdk.Isotope)isotopes.elementAt(0);
....
when it runs this line, it throws a ClassCastException
But when I printout isotopes.elementAt(0).getClass().getName()
it print out "cdk.Isotope".
Can't figure out why.
Please help! |
xt 发帖数: 17532 | 2 This is very strange. You must have sth else wrong. |
xt 发帖数: 17532 | 3
It can't be, otherwise JVM will throw LinkageError |
t***t 发帖数: 6066 | 4 recomiple everything?
【在 z****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I got a very weird exception : code: : ... : //isotopes is a Vector : cdk.Isotope iso = (cdk.Isotope)isotopes.elementAt(0); : .... : when it runs this line, it throws a ClassCastException : But when I printout isotopes.elementAt(0).getClass().getName() : it print out "cdk.Isotope". : Can't figure out why.
|
z****g 发帖数: 2497 | 5 It is a fresh compile. Really don't get it.
Anyway, I will try it.
【在 t***t 的大作中提到】![](/moin_static193/solenoid/img/up.png) : recomiple everything?
|