//BoxGeneric.java
//A simple generic version of a Box class.
//Here, T is a type parameter that will be replaced by an
//actual type when an object of type BoxGeneric is created.

public class BoxGeneric<T>
{
    private T t;

    public BoxGeneric(T t)
    {
        this.t = t;
    }

    public void setData(T t)
    {
        this.t = t;
    }

    public T getData()
    {
        return t;
    }

    //Show the type of the private instance variable t.
    public void showType()
    {
        System.out.println(
            "The type of t is " + t.getClass().getName() + "."
        );
    }
}
