This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "ClassCastException" Watch "ClassCastException" New topic
Author

ClassCastException

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I am getting this error ClassCastException: AccountFrame$AccountTransaction. What am I doing wrong?
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Candy
Try to know what object exactly you are getting in the vector as an element via,
System.out.println(transact.elementAt(i).getClass().getName());
and then see if it is really of the type you are looking for. If not then what did cause it to be of different type...
Regards
Maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastException
 
Similar Threads
accessing the setters/getters
writing to file from Vector
problem with reading data
HttpSession failure
using the getters