reset password
Author Message
knagrec2
Posts: 51
Posted 12:26 Oct 09, 2018 |

For example when checking the equality of student, do we also check the equality of its parent's datafields (first name, last name etc)? Or only the "student fields"?

kknaur
Posts: 540
Posted 12:59 Oct 09, 2018 |

Well, since Student is a Person..... and since Student has a First Name, Last Name, etc... I would say yes :).  Take a look at the Circle, Rectangle, GeometricObject classes from the polymorphism lecture and see how I implemented those equals() methods.

Last edited by kknaur at 12:59 Oct 09, 2018.