im trying to override the add() but it will not compile
public class AVLTree<E extends Comparable<E>> extends BinaryTree {
BinaryNode<E> theTree;
@Override
public void add (E toInsert)
{
if (theTree == null)
add(toInsert, theTree);
}
public class BinaryTree<E extends Comparable<E>> implements Iterable<E> {
public void add(E toInsert) { .... }
Error message
java:36: error: name clash: add(E#1) in AVLTree and add(E#2) in BinaryTree have the same erasure, yet neither overrides the other public void add (E toInsert) ^ where E#1,E#2 are type-variables: E#1 extends Comparable declared in class AVLTree E#2 extends Comparable declared in class BinaryTree
BinaryTreeshould have a type parameter when specialized byAVLTree. - Matt Ball