I’ve defined a sub-class and want to have two constructors with different parameters. It looks like this
public class GraphNode extends Entity{
protected String id;
public GraphNode(PVector pos, String id) {
super(pos,0);
this.id = id;
}
public GraphNode(PVector pos, String id, List<GraphEdge>) {
this(pos, id);
//do something else
}
}
The compiler keeps telling me that:
Duplicate method GraphNode(PVector, String) in type
GraphNode
What am I doing wrong?
You forgot to give your third argument a variable name: