I don't know how to phrase my question any better in the small space I had. Here's a better explanation:
I have a String[] test
with a length of 5. The class is used to edit test
to be editable in another class. Anyways my constructor passes in all 5 strings to be set to test
. I originally had it set up like so:
public Generic(String field1, String field2, String field3, String field4, String field5){
test[0] = field1;
test[1] = field2;
test[2] = field3;
test[3] = field4;
test[5] = field5;
}
But I found I wanted to use the methods I have in the class to set them instead. So instead of test[0] = field1;
I use setField1(field1);
, etc. All I have in setField1(String Field)
is the same thing that used to be in the constructor.
I just wanted to make sure that this isn't a dumb move to make, calling methods in my class in the constructor to set a variable. Or if I shouldn't employ that habit. Or my thinking is fine.
Thanks!