Given that I have a class Base that has a single argument constructor with a TextBox object as it\'s argument. If I have a class Simple of the following form:
Yes, there is a workaround for your simple case. You can create a private constructor that takes TextBox
as an argument and call that from your public constructor.
public class Simple extends Base {
private Simple(TextBox t) {
super(t);
// continue doing stuff with t here
}
public Simple() {
this(new TextBox());
}
}
For more complicated stuff, you need to use a factory or a static factory method.