reset password
Author Message
rgallegos
Posts: 29
Posted 15:46 Oct 13, 2018 |

The Database class is an ArrayList which already has an add method that takes a Person object. In order to remove and find we have to include some extra functionality that the ArrayList's remove/contains method cannot do on its own but I do not see what extra functionality addPerson requires. Has anyone done anything differently for addPerson() than they would have done for database.add(Person);?

knagrec2
Posts: 51
Posted 17:44 Oct 13, 2018 |

I had the same question. My addPerson method is essentially just super.add().

kknaur
Posts: 540
Posted 18:45 Oct 13, 2018 |

Its pretty much this.  You can use the add method from ArrayList or have a new method called addPerson, which basically invokes the one from ArrayList.