This particular case is awkward due to two meanings, but what you can do is call the static method.
public Foo(Integer x, Integer y) { this(new Integer[]{x, y}); } public Foo(String xy) { this(convertStringToIntegers(xy)); } private Foo(Integer[] xy) { this.x = xy[0]; this.y = xy[1]; } private static Integer[] convertStringToIntegers(String xy) { Integer[] result;
Moreover, if this class does not need a subclass, it would be clearer and better and more explicit in order to leave the constructors all private and have a public static factory method:
public static Foo createFoo(String xy) { Integer x; Integer y;
source share