Nenad
~Choco Coronet~ Omnomnom
- Reaction score
- 137
I have an assignment that i would like some help with, cause i have no idea what to place in this method.
The methodublic boolean method isMotherOf "Create a method that tests whether this Person is the mother of the Person given as an argument to the method. "
Now, I'm still a little confused as we are using fields here (which i never used before).
What i have at the moment is fields that are used to store these objects:
How am i supposed to check if a person is someones mother? I'm thinking it has something to do with comparing fields but i have no idea how to do that >.<
The methodublic boolean method isMotherOf "Create a method that tests whether this Person is the mother of the Person given as an argument to the method. "
Now, I'm still a little confused as we are using fields here (which i never used before).
What i have at the moment is fields that are used to store these objects:
Code:
public class Person {
String name;
Person mother;
Person father;
ArrayList<Person> children;
How am i supposed to check if a person is someones mother? I'm thinking it has something to do with comparing fields but i have no idea how to do that >.<