If I want to make an array of an ADT I create, let's say MyThing(int value,
String keyWord)...
The following code doesn't work:
MyThing[] thingy;
for( int i=0; i<6; i++ )
{
thingy[i] = new MyThing( anInt, aString );
}
Obviously, it gives me a null pointer cause i never said how many things were in my array. But writting MyThing[] thingy = new MyThing( anInt, aString )[6]; doesn't work either. Do I HAVE to use a array of Objects? Those get really messy... Let me know if you have any suggestions!
Zoy