Results 1 to 2 of 2
- 06-19-2012, 02:47 AM #1Member
- Join Date
- Jun 2012
- Rep Power
Caught: java.lang.ClassCastException: java.util.ArrayList cannot be cast to Point4D
I cant Understand the error, what is the meaning of this error? when it can occur? and as my code is very big and due to some reason I am unable to post the code, please help me .. Am developing it on IntelliJ, but its not showing the line number either, suggest me any way to get out of this error and make the code working.
Any debugging technique may also serve the perpose I think.
by the way Point4D is my defined class having four integers.
- 06-19-2012, 02:55 AM #2
Re: Caught: java.lang.ClassCastException: java.util.ArrayList cannot be cast to Point
The JVM caught the code trying to cast an object that is an ArrayList to be a Point4D and told you about it.
Why does the code try to do that? It is not possible.
You will have to post the lines of code where the error occurred and where the variables used on the line where the error occured are defined.
Add a println that prints the value that is being cast to see what it is if you do not believe the JVM.
its not showing the line numberIf you don't understand my response, don't ignore it, ask a question.
- By paulusi in forum New To JavaReplies: 2Last Post: 01-21-2011, 07:22 AM
- By gomsy123 in forum Advanced JavaReplies: 1Last Post: 03-19-2009, 06:39 PM
- By wrwelden in forum New To JavaReplies: 4Last Post: 05-22-2008, 03:43 PM
- By barney in forum Advanced JavaReplies: 1Last Post: 08-02-2007, 04:07 PM
- By fernando in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:52 AM