I want to know where it it is recommended to put logic such as if statements, shall I do it in the setter or in the getter? For example, when I tried to do this in the setter it was not working:
if ("female".equals(gender)) {
this.gender = "girl";
}
but it is working when I do it in the getter, and then I just return gender; and everything is as it should. So why was this statement not working in the setter?