I have class edge:
This gives me the compiler error:Code:public class GraphMap { private ArrayList _vertices; // ... deleted most of class, only important stuff... public void addEdge( int start, int end, double dist ) { Vertex tempVert = new Vertex(); tempVert = _vertices.get( start ); }
Incompatible type for =. Can't convert Object to Vertex.
tempVert = _vertices.get( start );
Why is this happening and can I get around it? Does using ArrayLists limit me to added classes that inherit Object class? Can I write an assignment operator for my Vertex class, if so what would a sample declaration line look like?
NOMAD




Reply With Quote