Ok I’ve been searching for this problem for a while.
I keep getting an error that I can’t instantiate abstractSet.
It keeps asking for a generic. I add the generic but still no dice.
import java.util.AbstractSet;
import java.util.Set;
public class UnorderedTree{
private Object root;
private Set subtrees; //Switched to AbstractSet
private int size;
public UnorderedTree(Object root){
this(root);
subtrees = new AbstractSet(); //ERROR HERE WITH <Object>
size=1;
}
}
Any pointers would help
As its name suggested, AbstractSet is abstract, you can not instantiate it. as its javadoc said:
You should use some concrete set like HashSet.