Abstract method[???]

Hello there,
I have a problem with the code im compiling it and it returns an error :
"BinarySearchTree is not abstact and does not override abstract method findNums(int, int , T) in Tree"
Can anyone tell me why's that happening ???
Thanks in advance !

code:

public class BinarySearchTree<T extends Comparable<T>> implements Tree<T>{

    private Node<T> rootNode;
   
    public int min;
    public int max;
   
    public boolean isEmpty(){
        return rootNode == null;
    }
 
    public void insert(T item){
        if (rootNode == null){
            rootNode = new Node<T>(item, null, null);
        }else{
            insertNode(item, rootNode);
        }
    }
   
    //Return all the between numbers of min & max
    public  T findNums(int min, int max, Node rootNode)
    {
        if (rootNode == null)
        {
            return null;
        }
        if (rootNode.data >= min)
        {
            this.findNums(min, max, root.leftNode);
            if (root.data <= max)
            {
                System.out.println(root.data);
            }
        }
        if (root.data <= max)
        {
           this.findNums(min, max, root.rightNode);
        }
    }
 
    //Minimum node
    public T minimum(){
        if (rootNode != null){
            return findMinimumNode(rootNode).getElement();
        }else{
            return null;
        }
    }
    private Node<T> findMinimumNode(Node<T> node){
        if (node.getLeftNode() == null){
            return node;
        }else{
            return findMinimumNode(node.getLeftNode());
        }
    }
   
    private Node<T> insertNode(T item, Node<T> node){
        if (node == null){
            node = new Node<E>(item, null, null);
        }else if (item.compareTo(node.getElement()) < 0){
            node.setLeftNode(insertNode(item, node.getLeftNode()));
        }else if (item.compareTo(node.getElement()) > 0){
            node.setRightNode(insertNode(item, node.getRightNode()));
        }else{
            ;
        }
        return node;
    }
   
    private static class Node<T extends Comparable<T>>{
        private T element;
        private Node<T> leftNode;
        private Node<T> rightNode;
       
        Node(T element, Node<T>leftNode, Node<T>rightNode){
            this.element = element;
            this.leftNode = leftNode;
            this.rightNode = rightNode;
        }
       
        void setLeftNode(Node<T> leftNode){
            this.leftNode = leftNode;
        }
       
        Node<T> getLeftNode(){
            return leftNode;
        }
       
        void setRightNode(Node<T> rightNode){
            this.rightNode = rightNode;
        }
       
        Node<T> getRightNode(){
            return rightNode;
        }
       
        T getElement(){
            return element;
        }
       
        void setElement(T element){
            this.element = element;
        }
     
    }
}

perdoname_Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
I believe that it is because you are not overriding a virtual member:

    public override T findNums(int min, int max, Node rootNode)

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
krakatoaCommented:
Comparable is an interface not a class, so it has to be implemented not extended.

For abstract classes, you need to render method bodies in your subclass.
0
Ajay-SinghCommented:
> Comparable is an interface not a class, so it has to be implemented not
extended.
 
 
The class is not extending Comparable
0
perdoname_Author Commented:
then what is wrong ??
:S:SS:SS
0
Ajay-SinghCommented:
> then what is wrong ??

See the comment of TheLearnedOne http://#20836564
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.