Trying to use this() in a constructor, not the first line
I'm currently re-writing some old code of mine that was used to create a neural network. My main contructor, originally, was
public Network(int sizeLayer1,int sizeLayer2,int sizeLayer3)
Now, however, I've decided that I want to make my network a little more general, and allow any number of layers. Therefore, my revised basic constructor is
public Network(int[] sizeLayers)
which expects an array of ints corresponding to the size of each layer.
However, I've got some old programs that use the old contructor which I can't change (and anyway, it's good to have the option to be able to use both). I therefore want to create a constructor that has the same signature as the old one, but simply places the values in an array and passes the array to the new constructor.
public Network(int sizeLayer1,int sizeLayer2,int sizeLayer3){
int[] sizeLayers ={sizeLayer1, sizeLayer2, sizeLayer3};
this(sizeLayers);
}
obviously won't work, because 'this' must be the first line of the constructor. How can I put my values in an array and call the new constructor?
Thanks!

