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.
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.
Do the catch blocks call the printStackTrace() method?
its not showing the line number