Hello, I am trying to implement an inner class that has generic parameterized type.
Here is my code (short version):
public class AVLTree<T extends Comparable<? super T>> implements Iterable<T> {
...
private class BinaryNode<T extends Comparable<? super T>> {
...
}
private class TreePreOrderIterator<E extends Comparable<? super E>> implements Iterator<E> {
...
}
}
It does not work, and Eclispe/Java is giving me a warning that the type T paramterizing the inner class is 'hiding'. Any thoughts on how I can fix this?
EDIT: I added the other inner class I'm having problems with - "TreePreOrderIterator". The generic type T will be the same for AVLTree, BinaryNode, and TreePreOrderIterator, but only the inner classes need to access fields in AVLTree.
EDIT2: Also, the Iterator accesses a BinaryNode, which is becoming a conflict...
(Note: This is part of bigger project I'm doing for a class. If any other information is needed, please ask.)