What you are doing is trying to create an array which will hold all Ts put into it. I suggest you do what ArrayList does: when the array is full replace it with a larger array, until it is as large as the limits of the
int datatype will permit.
This thread will show you where you can find out more about ArrayList.
Why do you need a Bag class? Why can't you use one of the standard Collections Framework classes? Can't you write a wrapper round ArrayList<T>?