Hi there
I think this is a beginners problem, if its not I apologize in advance. I`ve just created an array list using a class Point to add and get entries from the list.
The class for getting an object from the list looks like this:
public Object getDest(int Place)
{
if(DestinationList.isEmpty())
{
return null;
}
System.out.println("In class");
return DestinationList.get(Place);
}
This should return the Object to the calling code.
However when I call it in the main program using the line
Position NewPosition = (Position)DestinationList.getDest(Placement)
it comes up with a class not defined error. I assume this is because it cannot match the cast I`m using with the object it is bringing in.
However I have been through the code and the values being read in match the Position class that its being cast into.
Does anyone have any suggestions why the compiler is causing me the error?
If you want me to reprint the whole code I dont mind, I just did not want to clog up the whole
thread with it. And if I`ve not explained it well enough then I`m also sorry, first time at trying this!
I appreciate the help anyone can provide, thanks in advance!
[ January 27, 2006: Message edited by: Derrick Ritchie ]