Reputation: 11
I am implementing a Binary Search Tree with BinaryNode<T>
that holds the information. In my tree class I have this line of code:
public class BST<T> implements BSTInterface<T extends Comparable<? super T>>
This is causing many errors such as:
BST.java:10: error: > expected
public class BST<T> implements BSTInterface<T extends Comparable<? super T>>
^
BST.java:10: error: <identifier> expected
public class BST<T> implements BSTInterface<T extends Comparable<? super T>>
^
I am not sure why this isn't working because that line of code works for my interface. Any help would be much appreciated! I am probably making some stupid mistake.
Upvotes: 0
Views: 237
Reputation: 79847
I think you intended to write
public class BST<T extends Comparable<? super T>> implements BSTInterface<T>
You have to put the bounds on T
at the first mention of T
.
Upvotes: 11