passing an array into an instance
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:
the name of the array is campuses.
units[Unit.unitCount] = new Unit(name,code,sem1,sem2,campusCount,campuses);
in my Unit class, my Constructor looks like this...
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.
public Unit(String iName, String iCode, char iSemester1, char iSemester2, int iCampusCount)
campuses= new String;
Any help would greatly be appreciated.