以下代码是名为GreedyGraph的类的一小部分,它扩展了Graph类。
public class GreedyGraph extends Graph {
private final boolean DEBUG=false;
private GreedyPriorityQueue q;
private int components;
// constructor
public GreedyGraph(String name) throws java.io.IOException {
process_header(name);
add_vertices();
add_edges();
}
我的主要类ShortestPath包含以下代码:
public class ShortestPath extends GreedyGraph {
public ShortestPath(String name) throws IOException {
super(name);
}
当然,这个项目还有很多,而不仅仅是这些代码行。当我尝试运行它时,会出现以下错误代码:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Implicit super constructor GreedyGraph() is undefined. Must explicitly invoke another constructor
不应该发生这种情况吗?