As the title hints at, I am wondering if I am able to use functionality in a class's constructor from another constructor (overload) of the same class in Java.
Hopefully this code demonstrates what I'm trying to achieve (ignore the fact that children
gets overwritten, bad example in this case):
class Node {
int[] value;
ArrayList<Node> children;
Node ()
{
this.children = new ArrayList<>();
}
Node (int[] value)
{
this.value = value;
Node();
}
Node (int[] value, Node[] children)
{
this.children = new ArrayList<Node>(Arrays.asList(children));
Node(value);
}
}