Right now, I am trying to create an instance of a generic class BTree<T>
which implements an interface SSet<T>
which in turn implements Iterable<T>
I've deleted the bulk of the code out of the BTree<T>
class and left only the constructor. Though, if it's essential, I can add the entire code if anyone believes it is helpful. The BTree<T>
class looks something like this:
package assignment2_draft;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
public class BTree<T> implements SSet<T> {
//Some methods
public BTree(int b, Class<T> clz) {
this(b, new DefaultComparator<T>(), clz);
}
}
In my own class, I am trying to call the BTree<T>
class and pass an Integer into the generic. In my class, I have:
BTree<Integer> myTree=new BTree<Integer>(Integer.class);
which has worked in generic classes before, but not this class. I am wondering, am I passing in the parameters right? Or do I need to somehow reference SSet<T>
when creating an instance of BTree<T>