Let's say I have a class
public class Child {
public Child(Object arg1) {
super(arg1);
}
}
and I have a parent class
public class Parent {
Object object;
public Parent(Object arg1) {
this.object=arg1;
}
}
So my question is which would be a better coding practice
- Inserting the argument in the child and then passing it over to the parent
OR
- Inserting the argument in the parent itself without going through the child.
For clarity's sake let's say currently the child does not need the argument.