I have two constructors
MyObj(String s){ //first constructor
...
if(s==null) s = somecode;
this.s = s;
...
}
MyObj(): this(null) { } //second constructor
In this way, if the empty constructor is called, it will redirect to the first constructor and initialise the value as determined by some code.
However, now I have a third constructor
MyObj(Stream st){ //third constructor
...
}
Now the second constructor has no idea whether it is supposed to call the first constructor or the third. How do I tell it to call the first constructor? I tried MyObj(): this(String s = null)
and it doesn't work either.