Hi. I am just wandering how do I pass an array from one class into another class via a constructor?
In the class that i collect my information in, I have the following code:
units[Unit.unitCount] = new Unit(name,code,sem1,sem2,campusCount,campuses);
the name of the array is campuses.
in my Unit class, my Constructor looks like this...
public Unit(String iName, String iCode, char iSemester1, char iSemester2, int iCampusCount)
{
name=iName;
code=iCode;
campuses= new String[10];
semester1=iSemester1;
semester2=iSemester2;
unitCount++;
campusCount=iCampusCount;
but when i try to do a toString to print off values of the array, every value comes up as null, so I can only assume that they are not being set correctly in the first place.
Any help would greatly be appreciated.