Appreciate any help.
views:
198answers:
2
Q:
Classx is not abstract and does not override abstract method methodx(java.lang.Object) in Interfacex
A:
You should add the @Override annotation to the addNode() implementation in ListGraph:
@Override
public void addNode(N node){
nodes.put(node, new ArrayList<ListEdge<N>>());
}
matt b
2009-11-27 14:31:59
He doesn't have to. It's just convienient to do so, cause compilator can tell you if you try to override something incorrectly
Luno
2009-11-27 14:38:57
+2
A:
Change
public class ListGraph<N> implements graphs.Graph
to
public class ListGraph<N> implements graphs.Graph<N>
You're implementing a generic interface, so you have to provide the piece in the angle brackets. (sorry, brain gone blank, can't remember the exact terminology)
Glen
2009-11-27 14:44:39