Okay... I currently am in the process of creating a Radix Sort for this class that I'm taking. My whole problem is that I have created a generic type class called ADTQueue. I know that this class functions correctly. I now want to create an array of String type ADTQueue objects to use as "buckets" to throw objects from an original array of random numbers. So here is the actual probelm....
After I create my buckets, every time I try to use one of the ADTQueue buckets it says "java.lang.Nullpointerexception"
This is how I created it:
ADTQueue<String>[] buckets = new ADTQueue[10];
then when I try something like:
buckets[0].enqueue(someString);
I get the error of a null pointer, but I am pointing at the first ADTQueue object in the array at index 0.
If I create a bucket without an array it works correctly:
ADTQueue<String> aBucket = new ADTQueue();
aBucket.enqueue(someString);
System.out.println (aBucket.dequeue());
This then prints out the string correctly so I know the ADTQueue method in itself is not at fault...
**************************************…
So my question I suppose is:
How do I create an array using the generic type objects in string form?
Thanks so much for any help!