reset password
Author Message
Anonymous
Posts: 166
Posted 16:56 Apr 20, 2014 |

when we create the arrays to store the persons are we supposed to make different arrays for each person, one for students, one for staff and one for employees. or just one array with everyone in it

kknaur
Posts: 540
Posted 16:59 Apr 20, 2014 |

As stated in the directions for designing the Database Class "the only data field that you are allowed to have is an ArrayList of Person objects".

Anonymous
Posts: 166
Posted 17:02 Apr 20, 2014 |

that confused me a bit, so then the array would have to be on the class Person and then be used in the class Database?

kknaur
Posts: 540
Posted 17:03 Apr 20, 2014 |

No... the array is a data field in the Database class.

Anonymous
Posts: 166
Posted 17:10 Apr 20, 2014 |

so then we would only create one ArrayList with everyone in it (students,staff) and not one for each person(one for students, one for staff, etc) as in the first homework where we made one array for each category

kknaur
Posts: 540
Posted 17:11 Apr 20, 2014 |

Yes, in your driver/main/tester class you would create several objects of each type (Student, Faculty, Staff) and then store them all in one ArrayList of Person objects, and then pass that ArrayList to your Database class and call all the methods from the Database class to show the requested output.