Let's say I have two classes.
School & Students and I want to make a school object that holds many student objects. What will the code look like?
Thanks!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shane PoppletonPosted Jun 11, 2009, 1:30 AM
patrickPosted Jun 10, 2009, 10:23 AM
Just add the list object to the school class like you would any variable
patrickPosted Jun 10, 2009, 10:19 AM
then to add:
sList.add(someStudent);