Q:

Making one Data Structure Driver Class work for multiple object types in Java

I have had a search on SO, and found many similar questions, but none specifically relating to Java.
I am implementing a BST for a project I am working on, and I would like it to be able to use the same logic for multiple classes of objects as records. 
For example, I want one BSTDriver class where I can make a binary tree be able to accept and build trees with objects of type Fruits, Vegetables, Meats, etc, so that I don't have to make one BST driver class for each type of object. 
I am not new to Java, but as of now do not know how to do this.

A:

You're still pretty new to Java and Object Oriented Programming in general. This is not a bad thing, but recognize it and you will do better.
This is a job for an Interface class. Allow me to introduce you to the topic.
An interface provides two things: A top level object which you can operate on, taking implementation for granted, and the ability to contract with the future on the minimum set of operations the classes that implement you interface will have available.
For example, consider the terms Vehicle, Bicycle, Car, and Buick.  If I were to implement these as Java classes, I'd make Vehicle the interface with Bicycle and Car implementing it. Consider the following:
public interface Vehicle {
    public void move();
}

public class Bicycle implements Vehicle {
    int wheels;
    public Bicycle {
        wheels = 2;
    }
    @Override
    public void move() {
        //implementation for steering/pedaling the bike
    }
}

public class Car implements Vehicle {
    int wheels;
    int fuelCap;
    public Car {
        wheels = 4;
        fuelCap = 12; //12 gallon tank
    }
    @Override
    public void move() {
        //logic to drive the car
    }
}

Now any method that takes a Vehicle as will take a Bicycle or a Car, but you can only guarantee it the ability to move (though not how). This gets more useful with return types, but I've left them out for brevity. Go read the tutorial on the subject.

