PDA

View Full Version : Sending an array...?



craigtb
04-05-2007, 12:54 AM
I was wondering how i would get an array in a different class... for example

assume projects is an array


ListOfStudents[counter] = new Undergrad(projects);




public UnderGrad(projects)
{
}


how would i get that in the Undergrad part? because if it was an int i would need to put
public Undergrad(int projects)
but i dont knwo what to do for an array.
any help?

Twey
04-05-2007, 12:00 PM
Depends on the type of the array. Assuming projects is an array of Project instances, you'd do:
public UnderGrad(Project[] projects) {
}

craigtb
04-05-2007, 06:07 PM
That got it. thanks!!!